Java Operators

Java Operators

The Java operators are special characters. Using operators, java performs operations with operands.

Java operators are:

  • Arithmetic operators: + – * /%
  • Assignment operator: =
  • Comparison operators: < > <= >= == !=
  • Logical operators: && || !
  • Instanceof operator: new
  • Unary operators: + – ++ —
  • String concatenation operator: +

Arithmetic operators

OperatorDescription
+Additive operator
Subtraction operator
*Multiplication operator
/Division operator
%Remainder operator

Assignment operators

OperatorDescription
=Assignment operator

Comparison operators

OperatorDescription
==Equal to
!=Not equal to
>Greater than
>=Greater than or equal to
<Less than
<=Less than or equal to

Logical operators

OperatorDescription
&&And
||Or
!Not

Unary operators

OperatorDescription
+Plus operator
Minus operator
++Increment operator; increments a value by 1
Decrement operator; decrements a value by 1

Instanceof operator

OperatorDescription
newInstanceof operator

String concatenation operator

OperatorDescription
+String concatenation operator