if (booleanExpression) {
System.out.println("Inside if statement");
}
publicclass MainClass{
publicstaticvoid main(String[] argv){
int x = 1;
int y = 0;
int z = 0;
int a = 0;
if (x > 3) {
System.out.println("x is greater than 3");
} else {
System.out.println("x is not greater than 3");
}
//The else block is optional, so you can also use the following:
if (x > 3) {
y = 2;
}
z += 8;
a = y + x;
}
}