Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

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

 
Leon Omk
Ranch Hand
Posts: 75
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator


Isn't it better to return List<T> or Collection<T>? After all, we should code against interfaces, right?
 
Matthew Brown
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
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).
 
I child proofed my house but they still get in. Distract them with this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!