Java Control Statements

On Social Media

Decision Making Statements :

Java programming language provides following types of decision making statements.

(i) if statement – An if statement consists of a boolean expression followed by one or more statements.

Reference video: java if statement

(ii) if…else statement – An if statement can be followed by an optional else statement, which executes when the boolean expression is false.

Reference video: java if else statement

(iii) nested if statement – You can use one if or else if statement inside another if or else if statement(s).

Reference video: java nested if statement

(iv) if-else-if Ladder – A common programming construct that is based upon a sequence of nested ifs
is the if-else if..else ladder. It looks like this:

Reference video: java if-else-if Ladder

(v) switch statement – A switch statement allows a variable to be tested for equality against a list of values.

Reference video: java switch statement

Jump Statements :

When transferring programme control to the individual statements, jump statements are utilised. Jump statements, in other words, shift the program’s execution control to another section. Break and continue are the two different forms of jump statements in Java.

(i) break statement – Terminates the loop or switch statement and transfers execution to the statement immediately following the loop or switch.

(ii) continue statement – Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.


On Social Media

Leave a Reply

Your email address will not be published. Required fields are marked *