Powered by Blogger.

Enhanced for Loop and Program Solution | About Program

Enhanced for Loop and Program Solution:

The Java 2 Platform Standard Edition (J2SE) version 5.0 added enhanced for loop.

Enhanced for loop:-

 public class EnhanFor{
   public static void main(String [] args){
     int[] myArray = new int[5];
     for(int i=0; i<5; i++)
        myArray[i]=i+11;
 // Enhanced for loop
 for(int element : myArray){
     System.out.println(element);
   }
  }
 }

1 comment:

  1. I really enjoy the blog.Much thanks again. Really Great.
    Very informative article post. Really looking forward to read more. Will read on…


    oracle online training
    sap fico online training
    dotnet online training
    qa-qtp-software-testing-training-tutorial

    ReplyDelete