Java   View all facts   Glossary   Help
syntactic unit > statement > control flow statement > decision making statement > if-else statement > nested if-else statement
Upif-else statement

nested if-else statement comparison table
Subject have example contain is a kind of
if-else statement
int testscore; 
char grade;
if (testscore <= 90) {
grade = 'A';
} else if (testscore <= 80) {
grade = 'B';
} else {
grade = 'C';
}
 decision making statement
nested if-else statement
if (length < 10) {
System.out.println("Small");
} else {
if (length < 20){
System.out.println("Medium");
} else {
System.out.println("Large");
}
}
an if statement or an if-else statement as its embedded statementsif-else statement

Upif-else statement