Java Operators
Operators are symbols which can function as logical and mathematical operation in Java program.
An operator is a symbol that represents and tells the compiler to perform some specific mathematical or logical manipulations. The value that the operator operates is known as operands.

Below are Operators which are used in the java program:
- Arithmetic operators
- Assignment operators
- Relational operators
- Logical operators
- Bit-wise operators
- Conditional operators (ternary operators)
- Increment/decrement operators
Operators | Description | Examples |
---|---|---|
Arithmetic operators (+,-,*,%,/) | Addition of two number | A=10, B=20, C=A+B, C=30 |
Assignment operators (=, ^=, -=, *=, /=, %=, &=, +=) | Assigns values from right side operands to left side operand | x=10, y=20, the value of x+y assign to z |
Relational operators (>, <, >=, <=, ==, != ) | Check the two values are equal or not. If yes, then the condition becomes true. | (A == B) and (10==10) is true. |
Logical operators (&& , ||, !) | If (A && B) are non-zero, then the condition becomes true. | int a=10, b=2; if(a==10&&b==2) is true |
Bitwise operators (&, |, ~, ^, <<, >>) | [& – Bitwise AND, | – Bitwise OR, ~ – Bitwise NOT, ^ – XOR, << – Left Shift, >> – Right Shift] | int a=10, b=14; if(a& b) is true |
Conditional operators (ternary operators)(?:) | (Condition? true_value: false_value); | (A > 100 ? 0 : 1); |
Increment/decrement operators(++, --) | Pre/Post-increment, Pre/Post-decrement | int i=10; i++; |
Quickly Find What You Are Looking For
Onlinetpoint is optimized for basic learning, practice and more. Examples are well checked and working examples available on this website but we can't give assurity for 100% correctness of all the content. This site under copyright content belongs to Onlinetpoint. You agree to have read and accepted our terms of use, cookie and privacy policy.