Java   View all facts   Glossary   Help
syntactic unit > statement > control flow statement > decision making statement > if statement
Next decision making statementif-else statement    Updecision making statement    Previous decision making statementtry-catch-finally statement   

if statement comparison table
Subject terminate by omit have example have syntax have purpose be have syntax rule contain is a subtopic of is a kind of have part
nested if statementa semicolonbraces if there is only one embedded statement
if (operation == '+')
add(object1,object2);
else if (operation == '-')
subtract(object1,object2);
else if (operation == '*')
multiply(object1,object2);
else if (operation == '/')
divide(object1,object2);
if  (boolean expression) {
embedded statement(s)
}
to make a decision on which branch of code to follow in a programnot more than one line long if possible
bold = mandatory
italic = non-terminal
normal font = optional
an if statement or an if-else statement as its embedded statementLoops and Decision Makingif statementboolean expression

Next decision making statementif-else statement    Updecision making statement    Previous decision making statementtry-catch-finally statement