Showing posts with label nested if. Show all posts
Showing posts with label nested if. Show all posts

Friday, 3 January 2014

Nested if Statement in Java

The most common Control Statements in Java

Control Statement Nested if


The nested if Statement:

Nested if are very common in programming. Nesting an if  Statement just means putting one if Statement inside of another. when you nest ifs, the main thing to remember is that an else statement always refers to the nearest if statement that is with  in the same block as the else and that is not already associated with an else.

Saturday, 2 February 2013

Introduction to Control Statements in Java


Control statements decide flow of a program

JAVA CONTROL STATEMENTS

if, if-else, switch, nested if, switch, for, while, do-while, break, continue and return control statements


Control statements are used in programming languages to cause the flow of control to advance and branch based on changes to the state of a program. The statements inside your source files are generally executed from top to bottom, in the order that they appear. Control flow statements, however, break up the flow of execution by employing decision making, looping, and branching, enabling your program to conditionally execute particular blocks of code.
In Java, control statements can be divided under the following three categories: