Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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).
 
    Bookmark Topic Watch Topic
  • New Topic