This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Why does Collections.list(Enumeration<T> e) return ArrayList<T>? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

Why does Collections.list(Enumeration<T> e) return ArrayList<T>?

Leon Omk
Ranch Hand

Joined: Aug 17, 2010
Posts: 75



Isn't it better to return List<T> or Collection<T>? After all, we should code against interfaces, right?


OK, so that other guy knows Java better than I do, but I bet he can't speak Wuhanese(a Chinese Dialect) like me.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

Duplicate of http://www.coderanch.com/t/557238/java/java/Why-does-Collections-list-Enumeration. Leon, can you avoid posting the same question to more than one thread? Thanks.

(I'll lock this one).
 
 
subject: Why does Collections.list(Enumeration<T> e) return ArrayList<T>?
 
Similar Threads
K&B Java5: Generics question #16 on page 620
why doesnt this compile?
Implementation of Arrays.asList( .. )
converting int array to List
Why does Collections.list(Enumeration<T> e) return ArrayList<T>?