How to Use Comparison Operator in Java


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

Source Code

package com.beginner.examples;

public class Comparison {
  public static void main(String[] args) {
    int a = 7;
    int b = 1;
    System.out.println(a == b); // use comparison operator
  }
}

Output:

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