ساختار if

 

if ( Num  == 2 )

}

System.out.print ("Number is two");

{

 

ساختار if و else

if ( Num  == 2 )

{

System.out.print ("Number is two");

}

else

{

System.out.print ("Number is not two");

}