what is the meaning of the <E> at Class ArrayList<E> ...?
ArrayList (Java 2 Platform SE 5.0)
E is simply the variable name that refers to the class of the object that is being used in the array list. For example, if you wanted to declare an ArrayList of Integers, you would use the following code:
In this case, E would refer to the Integer class. Generics in Java often use single character capital letters to represent these types of things. Hope this explanation helps.Code:ArrayList<Integer> ints = new ArrayList<Integer>();
i get it ..~ looks like i have to study generic first ..~ haha
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks