Java   View all facts   Glossary   Help
syntactic unit > symbol > operator > binary operator
Next operatorbitwise operator    Upoperator    Previous operatorassignment operator   

binary operator comparison table
Subject indicate have syntax be is a kind of is a subtopic of have example is an instance of have purpose evaluate return use by
!=     Operators relational operatorto return true if the operands are not equal a value called its result 
% modulus
operand1 % operand2
  Operators binary operatorto compute the remainder of dividing one operand by another a value called its result 
&     Operators logical operatorto return true if both operands evaluate to trueboth its operandsa boolean 
&& logical AND   Operators short circuit operatorto return true if both operands evaluate to trueits second operand only if the first operand returns truea boolean 
* multiplication
operand1 * operand2
  Operators binary operatorto multiply one operand by another a value called its result 
+
  • + indicates string concatenation
  • if its operands have type String
  • otherwise + indicates addition
addition
operand1 + operand2
said to be an overloaded operator because it has two different meanings depending on the types of its operands Operators binary operatorto add two operands together or to perform string concatenation a value called its result 
- subtraction
operand1 - operand2
  Operators binary operatorto subtract one operand from another a value called its result 
/ division
operand1 / operand2
  Operators binary operatorto divide one operand by another a value called its result 
<       relational operatorto return true if the first operand is less than the second operand a value called its result 
<=     Operators relational operatorto return true if the first operand is less than or equal to the second operand a value called its result 
==     Operators relational operatorto compare any two variables to test if they are identical, which means they either refer to the same objects or have the same primitive values a booleanboolean data type
>     Operators relational operatorto return true if the first operand is greater than the second operand a value called its result 
>=     Operators relational operatorto return true if the first operand is greater than or equal to the second operand a value called its result 
caret     Operators bitwise operatorto perform a bitwise exclusive or a value called its result 
instanceof operator    binary operatorOperatorssylvester instanceOf Dog //returns false
fido instanceof Dog //returns true
 to return true if the instance is either a direct instance of the given class or of a subclass of that class a value called its result 
|     Operators logical operatorto return true if at least one of its operands evaluates to trueboth its operandsa boolean 
|| logical OR   Operators short circuit operatorto return true if at least one of its operands evaluates to trueits second operand only if the first operand returns falsea boolean 

Next operatorbitwise operator    Upoperator    Previous operatorassignment operator