We assume you are pretty much familiar with operators (+ , – , * , / , =) used in mathematical operations. Java (or be it any other programming language) also provides us with such operators to carry out various logical operations.
Operators play very important role in building logic. Operators are used to manipulate variables.
There are many types of operators in java –
- Arithmetic Operator
- Relational operators
Let A = 6 & B = 3.
- Bitwise Operator
We assume you know about the truth table. If not please learn truth table for OR, AND & NOT. Bitwise operator works on bits and performs bit-by-bit operation.
Let A = 10 & B =12.
In binary form value of A = 0000 1010 &
B = 0000 1100
- Logical Operator
Assume there are two Boolean variables A & B.
boolean A = true;
boolean B = false;
- Assignment operator
- Misc Operators
These operators will help you understand looping conditions which you will learn in next tutorials.