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

nested if statement
subjectfact 
nested if statementhas example
if (operation == '+')
add(object1,object2);
else if (operation == '-')
subtract(object1,object2);
else if (operation == '*')
multiply(object1,object2);
else if (operation == '/')
divide(object1,object2);
added by: JK, source: Teach Yourself Java 2 in 21 Days, 2001-10-19 11:37:29.0
is a subtopic of Loops and Decision Making2001-10-19 11:37:29.0
is a kind of if statementadded by: JK, source: On To Java, 2001-10-19 11:37:29.0
may contain an if statement or an if-else statement as its embedded statementadded by: JK, source: On To Java, 2001-10-19 11:37:29.0
if statementcan omit braces if there is only one embedded statement2001-10-19 11:36:52.0
has part boolean expression2001-10-19 11:36:52.0
has syntax
if  (boolean expression) {
embedded statement(s)
}
2001-10-19 11:36:52.0
decision making statementhas purpose to make a decision on which branch of code to follow in a program2001-10-19 11:36:35.0
statementis terminated by a semicolon    2001-10-19 11:37:57.0
should be not more than one line long if possible2001-10-19 11:37:57.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0