Sunday 22 January 2017

Control Statements in Java


                                               
control statements in java


A programming language uses control statements to cause the flow of execution to advance and branch based on changes to the state of a program.

In java the control statements can be categorized as Selection , Iteration and Jump.

The Selection statements allows your program to choose different paths  of execution based upon the outcome of an expression or the state of variable.

The Iteration statements enable program execution to repeat one or more statements.

The Jumping statements allow your program to execute in a non-linear fashion. They allow the programmer to control the flow of the programs execution based upon the conditions that known only at the run time.

The java's selection statements are if , if-else , nested if , else if ladder , switch. They create loops. Loops repeatedly executes the same set of instructions untill a termination condition is met.

The Iteration statements are While , do-while , for loops.

The jumping statements are break , continue and return. These statements transfer the control to the another part of the program. 


                                                                            By: Knowledge Bits

No comments:

Post a Comment

Video of the Day

Contact us

Name

Email *

Message *