Java Reference
In-Depth Information
1. Simple if statement
If the condition given in if is true then only the statements corresponding to that if block is
executed.
Syntax of if statement
if(condition)
{
If condition is true , these Statements written inside curly brackets will be executed .
}
Program
public class ifstatement
{
public static void main(String args[])
{
int test1=10;
if (test1>10)
system.out.println(“you are wrong”);
if(test1>5)
{
System.out.println("good");
}
}
}
Search WWH ::




Custom Search