JAVA IF ELSE STATEMENT



Java if else statement is the most common logic statement for your java program. Just like English you use IF statement to run next statement based on the conditional value in the if else parameter.

For example

Int value =12;

If (value < 10){
System.out.println ("less than 10");
}
Else if ( value > 20) {
System.out.println("more than 20");
}
Else{
System.out.println("anything else");
}

JAVA IF ELSE STATEMENT JAVA IF ELSE STATEMENT Reviewed by Admin on 9:35 PM Rating: 5

No comments:

Powered by Blogger.