Java View all facts Glossary Help |
| syntactic unit > symbol > operator > binary 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 operator | to return true if the operands are not equal | a value called its result | ||||||||
| % | modulus | operand1 % operand2 | Operators | binary operator | to compute the remainder of dividing one operand by another | a value called its result | ||||||
| & | Operators | logical operator | to return true if both operands evaluate to true | both its operands | a boolean | |||||||
| && | logical AND | Operators | short circuit operator | to return true if both operands evaluate to true | its second operand only if the first operand returns true | a boolean | ||||||
| * | multiplication | operand1 * operand2 | Operators | binary operator | to multiply one operand by another | a value called its result | ||||||
| + | addition | operand1 + operand2 | said to be an overloaded operator because it has two different meanings depending on the types of its operands | Operators | binary operator | to add two operands together or to perform string concatenation | a value called its result | |||||
| - | subtraction | operand1 - operand2 | Operators | binary operator | to subtract one operand from another | a value called its result | ||||||
| / | division | operand1 / operand2 | Operators | binary operator | to divide one operand by another | a value called its result | ||||||
| < | relational operator | to return true if the first operand is less than the second operand | a value called its result | |||||||||
| <= | Operators | relational operator | to return true if the first operand is less than or equal to the second operand | a value called its result | ||||||||
| == | Operators | relational operator | to 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 boolean | boolean data type | |||||||
| > | Operators | relational operator | to return true if the first operand is greater than the second operand | a value called its result | ||||||||
| >= | Operators | relational operator | to return true if the first operand is greater than or equal to the second operand | a value called its result | ||||||||
| caret | Operators | bitwise operator | to perform a bitwise exclusive or | a value called its result | ||||||||
| instanceof operator | binary operator | Operators | sylvester 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 operator | to return true if at least one of its operands evaluates to true | both its operands | a boolean | |||||||
| || | logical OR | Operators | short circuit operator | to return true if at least one of its operands evaluates to true | its second operand only if the first operand returns false | a boolean |
Next operator: bitwise operator Up: operator Previous operator: assignment operator