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);
}
}
}
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);
}
}
}
I really enjoy the blog.Much thanks again. Really Great.
ReplyDeleteVery 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