aspose file tools*
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 Spring in Action this week in the Spring 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: 4422
    
    8

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).
 
jQuery in Action, 2nd edition
 
subject: Why does Collections.list(Enumeration<T> e) return ArrayList<T>?