Print Logical AND Result
This program prints the result of a logical AND operation.
Problem Statement
Write a Java program that evaluates a logical AND expression.
Source Code
| 1 | public class LogicalAnd { |
| 2 | public static void main(String[] args) { |
| 3 | boolean result = (5 > 2) && (10 > 3); |
| 4 | System.out.println("Result of AND: " + result + " - Eduinq"); |
| 5 | } |
| 6 | } |
Program Output
Result of AND: true - Eduinq
Explanation
(5 > 2) && (10 > 3) Both conditions true, so result is true. Prints result. Conclusion: Shows logical AND operator usage.