Thursday, December 20, 2012

Learning the Java Language, Part 21: Control Flow Statements

Control flow statements alter the order in which the statements in your program are executed. If your program were a network of railroad tracks and the running of your program were analogous to a train running on that network, the control flow statements would be like switch levers affecting which section of track you run next.

The implicit order of execution in the absence of any control flow statements is from the top of your program to the bottom. In the posts that follow, we'll see how with Java you can, by testing conditions in your program, decide which statements to execute next with if-then, if-then-else, and switch constructs, repeat statements with while, do while, and for constructs, and exit loops and methods how and when you want to with break, continue, and return.

Next up: The if-then and if-then-else Statements

1 comments:

Suresh kumar said...

Thanks for your grateful informations, am working in FNT software solutions, so it will be helpful info for my works.

Post a Comment

 
;