< Prev
Next >

Nested if Statement

In nested-if decision making statement, an if statement is nested inside an outer if statement, hence it is named nested if.

The statement connected to the nested if statement is only executed when -:

nested if example

// nested if statement 

public class NestedIf

public static void main(String... ar)
	if(99<101)  // This is a nested if 
	System.out.println("99 is less than 100 & 99 is also less than 101");

	System.out.println("99 is not less than 100");



99 is less than 100 & 99 is also less than 101

Please share this article -

Facebook Google Pinterest Reddit Tumblr Twitter

< Prev
Next >
< Else-If Statement
Nested If-Else Statement>

Please Subscribe

Please subscribe to our social media channels for daily updates.

Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page


Please check our latest addition