Topics Index

Control Statements > Selection Statements >
Siva Nookala - 23 Aug 2016
Java supports two selection statements - if and switch. These statements allow us to control the flow of the program. Depending upon the expressions or values, the corresponding blocks/statements of code will be executed or by passed.

Selection statements,Selection statements in java,Java selection statements,Java select statement,Java select,Java switch statement,Switch statement in java ,Switch case example java
The two statements are
  • if statement is a conditional branch statement. This is a two way branch statement. Depending upon the whether a condition is true or false, the corresponding code is executed.
  • switch statement is a multiway branch statement. Depending upon the value used for switching, the corresponding code is executed.

These two statements are very powerful and are used widely across any application. They provide effective solutions for branching problems.

Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App