Java View all facts Glossary Help |
syntactic unit > statement > control flow statement > decision making statement |
decision making statement comparison table |
Subject | avoid by | omit | have example | have syntax | have purpose | is a subtopic of | is a synonym of | is a kind of | have part |
---|---|---|---|---|---|---|---|---|---|
if statement | braces if there is only one embedded statement | if (boolean expression) { | to make a decision on which branch of code to follow in a program | Loops and Decision Making | decision making statement | boolean expression | |||
if-else statement | braces if there is only one embedded statement | int testscore; | if (boolean expression) { | to make a decision on which branch of code to follow in a program | Loops and Decision Making | decision making statement | else block | ||
switch-case statement | using polymorphism | the keyword default and the default statements if they are not needed | int month; | switch(integer producing expression) | to execute one of a choice of statements depending on the value of a variable | Loops and Decision Making | case statement | decision making statement | |
try-catch-finally statement | //Any division by zero that occurs when executing the try block will result in execution of the catch block. | try{ | to handle exceptions | Exception Handling | exception statement | try block, catch block(s), finally block |
Next control flow statement: exception statement Up: control flow statement Previous control flow statement: continue statement