TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Java Tutorials

Java Arithmetic Expressions

Overview

In this tutorial, we will learn about Java arithmetic expressions. A Java expression is a combination of operands, operators, constants, and function calls that reduces to a value.

Types of Arithmetic Expressions

  • Integer Expressions
  • Floating point expressions
  • Mixed mode expressions

Integer expressions

When all the operands in the expression are of integer types such an expression is called an integer expression.

For example:

int x = 10;

int y = 12;

int result;

result = x + y;

Floating-point expressions

When all the operands in the expression are of a real type such as float/double types such an expression is called a floating-point expression.

For example:

float x = 10.5;

float y = 12.63;

float result;

result = x + y;

Mixed mode expressions

When some operands in the expression are integer and others of a real type such as float/double types such an expression is called a mixed mode expression.

For example:

float x = 12.55;

int y = 10;

float result;

result = x + y;

—

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Related Posts

Download Greenfoot Windows

Java Tutorials /

Download & Install Greenfoot on Windows

Java Tutorials /

Java Static Code Analysis

Java Tutorials /

Java Testing Tools

Java Tutorials /

Handle Multiple Exceptions in Java

Exceptions_In_Java

Java Tutorials /

Exceptions in Java Programs

‹ Java Trigonometric Functions with Examples› Declare Java variables

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com