Java Operators
Last updated
Was this helpful?
Last updated
Was this helpful?
Operator is a special symbol that tells the compiler to perform specific mathematical or logical Operation. We can divide all the Java operators into the following groups:
Arithmetic Operators
Relational Operators
Logical Operators
Assignment Operators
Ternary or Conditional Operators
Given table shows the entire Arithmetic operator supported by Java Language. Let's suppose variable A hold 8 and B hold 3.
Which can be used to check the Condition, it always returns true or false. Let’s suppose variable A hold 8 and B hold 3.
Which can be used to combine more than one Condition? Suppose you want to combined two conditions AC, then you need to use Logical Operator like (AC). Here && is Logical Operator.
This can be used to assign a value to a variable. Lets suppose variable A hold 8 and B hold 3.
If any operator is used on three operands or variable is known as ternary operator. It can be represented with " ?
this statement can be read as “If testCondition is true, assign the value of value1 to result; otherwise, assign the value of value2 to result.