Subject |
use |
use in |
have example |
have syntax |
have purpose |
be |
|
is an instance of |
indicate |
% | an infix notation | | | operand1 % operand2 | to compute the remainder of dividing one operand by another | | | binary operator | modulus |
* | an infix notation | | | operand1 * operand2 | to multiply one operand by another | | | binary operator | multiplication |
+ | an infix notation | | | operand1 + operand2 | to add two operands together or to perform string concatenation | said to be an overloaded operator because it has two different meanings depending on the types of its operands | - + indicates string concatenation
- if its operands have type String
- otherwise + indicates addition
| binary operator | addition |
++ | | prefix or postfix form | example expression | equivalent longer expression |
---|
a++; b=a++; ++a; b=++a; | a=a+1; b=a; a=a+1; a=a+1; a=a+1; b=a; |
| | to increment its operand by one | | | unary operator | |
- | an infix notation | | | operand1 - operand2 | to subtract one operand from another | | | binary operator | subtraction |
-- | | prefix or postfix form | example expression | equivalent longer expression |
---|
a--; b=a--; --a; b=--a; | a=a-1; b=a; a=a-1; a=a-1; a=a-1; b=a; |
| | to decrement its operand by one | | | unary operator | |
/ | an infix notation | | | operand1 / operand2 | to divide one operand by another | | | binary operator | division |