In this example we will show you how to use the if statement in Java.
Source Code
package com.beginner.examples;
public class If {
public static void main(String[] args) {
if (2 > 1) { // use the if statement
System.out.println("OK");
}
}
}
Output:
OK