View RSS Feed

Recent Blogs Posts

  1. Java's Generic For Loop

    by , 02-18-2012 at 03:40 PM
    Generic consists of “new for loop”, that is known as “for each loop”. New for loop iterates the generic collections and also supports to integrate. Iteration over a List or Generic set is explained by this code:
    Generic List gets iterated by this code:

    Java Code: This is the code to explain the Generic For Loop
    List<String> list = new ArrayList<String>;
    for(String aString : list) {
        System.out.println(aString);
    }
    For loop parenthesis, declaration of a String variable is done. ...
    Categories
    Generics