Software >> Development >> Languages >> Java >> Operators >> What are the Java operators

Arithmetic addition - subtraction * multiplication / division % modulus increment -- decrement Bitwise logical ~ bitwise unary NOT & bitwise AND | bitwise OR ^ bitwise EXCLUSIVE OR Bitwise shift >> shift right >>> shift right, zero fill << shift left eg. value << num : shifts all of the bits in value to the left num times Boolean Logical & logical AND | logical OR ^ logical XOR || short-circuit OR && short-circuit AND ! Logical unary NOT == Equal to != not equal to ?: ternary if then else : eg. exp1 ? exp 2 : exp3 if exp1=true => evaluate exp2 else evaluate exp3 Class . member of a class Relational == Equal to != Not equal to > Greater than < Less than >= Greater than or equal to <= Less than or equal to if (done == 0) if (num != 0)