Logical Operators in Java


Logical operators are used in conditional statements to combine two or more conditions.

Source Code

boolean a = true;
boolean b = false;
System.out.println(a && b); // Logical AND - false
System.out.println(a || b); // Logical OR - true
System.out.println(!a); // Logical NOT - false
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments