O'Reilly logo

Java Programming by Hari Mohan Pandey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3 Introduction to Operators and Expression in Java

3.1 INTRODUCTION

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.

Operator Symbolic Representation
Arithmetic +, -, /, *, %
Logical &&, ||, !
Relational >, <,<=,>=, = =, ! =
Assignment =
Increment ++
Decrement --
Comma

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required