How to Check If an Expression Is True Or False in Java


In this example we will show you how to find out if an expression is true or false in Java.

Source Code

package com.beginner.examples;

public class FindOutExpression {
  public static void main(String[] args) {
    int a = 5;
    int b = 7;
    System.out.println(a > b); // find out if an expression is true or false
  }
}

Output:

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