java
Arithmetic Operators Used for basic mathematical operations.
Example (a = 10, b = 5) Result + Addition a + b 15 - Subtraction a - b 5 * Multiplication a * b 50 / Division a / b 2 % Modulus (Remainder) a % b 0
Relational Operators
Used to compare two values, returning true or false. Operator Description Example (a = 10, b = 5) Result == Equal to a == b false != Not equal a != b true > Greater than a > b true < Less than a < b false >= Greater or equal a >= b true <= Less or equal a <= b false
Assignment Operators
= a = b — += a += b a = a + b -= a -= b a = a - b *= a *= b a = a * b /= a /= b a = a / b %= a %= b a = a % b
Ternary Operator
variable = (condition) ? valueIfTrue : valueIfFalse;
Example:
int age = 18;
String result = (age >= 18) ? "Adult" : "Minor"; 
                  Operators Example in Java
public class OperatorsExample {
    public static void main(String[] args) {
        int a = 10, b = 5;
        // Arithmetic
        System.out.println("Addition: " + (a + b));
        System.out.println("Subtraction: " + (a - b));
        // Relational
        System.out.println("Is a > b? " + (a > b));
        // Logical
        boolean x = true, y = false;
        System.out.println("x && y: " + (x && y));
        // Assignment
        a += 5;
        System.out.println("After a += 5: " + a);
        // Ternary
        String status = (a > b) ? "a is bigger" : "b is bigger";
        System.out.println(status);
    }
}