L025 | Operators and its Forms (UNARY, BINARY, TERNARY) in Java
An operator is a special symbol in Java that is used to perform operations on variables and values.
Example:
int a = 5, b = 3;
int sum = a + b; // '+' is the addition operator
Here:
a and b are operands (values on which operations are performed).+ is the operator.sum stores the result of the operation.Example:
int result = (10 + 5) * 2;
Here:
(10 + 5) is an expression producing 15.2 multiplies that result to get 30.