What are the different types of Operators in Java?

What are the different types of Operators in Java

web design agency uk's picture

Mobile App Developers

Java OperatorsExample: 

although the + operator is often used to add together two values, like in the example above, it can also be used to add together a variable and a value, or a variable and another variable

int x = 100 + 50;

Java divides the operators into the following groups:

  • Arithmetic operators
  • Assignment operators
  • Comparison operators
  • Logical operators
  • Bitwise operators

Operator  +  Addition (Adds together two values)

Example: x + y  Try it »

Operator -  Subtraction  (Subtracts one value from another)

Example: x - y  Try it »

Operator * Multiplication (Multiplies two values)

Example: x * y   Try it »

Operator / Division  (Divides one value by another)

Example: x / y  Try it »

Operator % Modulus (Returns the division remainder)

Example: x % y  Try it »

Operator ++ Increment (Increases the value of a variable by 1)

Example: ++x Try it »

Operator --  Decrement (Decreases the value of a variable by 1)

Example: --x  Try it »

We are working as android app development company and outsourcing mobile app developers around the world.

Vote the answer: 
0
No votes yet