A Java operator can be used to perform operations on a set of values. There is a wide range of Java operators, which are divided into unary, binary and ternary operators. Unary means the Java operator has a single digit, binary means a two-digit operator, and the ternary conditional operator has three digits.
Negation is an example of a unary Java operator, which is expressed as “!example”. Subtraction is a binary Java operator since it requires two operands (a – b). The only Java ternary operator that exists is the conditional operator, which works according to the “if-then-else” method: