Monday, April 27, 2015

Types of Java Loop



There may be a situation when we need to execute a block of code several number of times, and is often referred to as a loop.

Java has very flexible three looping mechanisms. You can use one of the following three loops:

  1. while Loop
  2. do...while Loop
  3. for Loop
As of Java 5, the enhanced for loop was introduced. This is mainly used for Arrays.

No comments:

Post a Comment