For performing different kinds of operations, various types of operators are required. An operator denotes an operation to be performed on some data that generates some value. For example, a plus operator (+) on 3 and 4 generates 7 (3 + 4 = 7). Here, 3 and 4 are called operands.
Java is rich in built-in operators. The four main classes of operators are arithmetic, relational, logical and bitwise.
Apart from these, there are many other operators. A list of operators provided by Java is given in Table 3.1.
|Arithmetic||+, -, /, *, %|
|Logical||&&, ||, !|
|Relational||>, <,<=,>=, = =, ! =|