Java examples for Language Basics:if
If statement is used to execute an action if particular condition is true.
Syntax of if statement is,
if(<condition>)
<statement>
public class Main { public static void main(String[] args) { boolean blnStatus = true; if(blnStatus){ System.out.println("Status is true"); }/* w w w. ja v a 2s .c o m*/ } }