Question #70456

How to do control of selection in java?

Expert's answer

Java provides selection statements that allow the program to choose between alternative actions during execution. The choice is based on criteria specified in the selection statement. These selection statements are
• simple if Statement
• if-else Statement
• switch Statement
Sources:
• The if-then and if-then-else Statements
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/if.html
• The switch Statement
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html
• Selection Statements
https://etutorials.org/cert/java+certification/Chapter+5.+Control+Flow+Exception+Handling+and+Assertions/5.2+Selection+Statements/
LATEST TUTORIALS
APPROVED BY CLIENTS