*Operators *
Operators are symbols that perform operations on variables and values.
Arithmetic Operators
Used for mathematical calculations such as addition, subtraction, multiplication, and division.
Example:
int result = 10 + 5;
Relational Operators
Used to compare two values and return a boolean result.
Example:
System.out.println(a > b);
Logical Operators
Used to combine or reverse boolean conditions.
Example:
boolean output = (a > b) && (b > 0);
Assignment Operators
- Used to assign or update values in variables.
- It is represented as "=" Example:
int x = 10;
x += 5;
Top comments (0)