26-12-24 ----------- Flow Control Statements --------------------------- Q)What features should an application's code posses to solve a computing problem? 1)sequence 2)selection 3)iteration Note:- sequence feature is implicitly available to every Java application. =>By using flow control statements in an application, we can get selection & iteration features to a Java application. Q)What is a flow control statement?How are flow control statements classified? =>A statement that controls the order of execution of other statements of the application is known as a flow control statement. =>There are 2 types of flow control statements in Java. 1)selection/branching statements 2)repetetion/iteration/looping statements =>In Java, following are the branching statements. 1)simple if statement 2)if else statement 3)if else ladder statement 4)nested if statement 5)switch statement =>In Java, following are the repetetion statements 1)for statement 2)while statement 3)do while statement 4)for each statement/enhance for statement Note:- an if statement without "else" statement is known as a simple if statement. if(condition){ //statements } =>code enclosed between the flower braces here is known as the body of simple if statement. =>When the condition is true, body of if statement is executed. When condition is false, its body is not executed. Q)What is the output of the following Java application? class Test { public static void main(String[] args) { int a=10,b=20,c=40; if(a>b && bb || b