Home / Java Tips Generated By ChatGPT / Equality Operators in Java Use == and != to check equality and inequality respectively. Source Code int a = 5; int b = 3; System.out.println(a == b); // Equality check - false System.out.println(a != b); // Inequality check - true