How to Use Logical Operator in Java


In this example we will show you how to use logical operator in Java.

Logical operator

Source Code

package com.beginner.examples;

public class LogicalOperator {
  public static void main(String[] args) {
    int a = 3;
    System.out.println(a > 5 && a < 7); // use logical operator
  }
}

Output:

false
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments