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 Beginning Java and the fly likes Enumeration or Array as return type 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 » Java » Beginning Java
Bookmark "Enumeration or Array as return type" Watch "Enumeration or Array as return type" New topic
Author

Enumeration or Array as return type

Stephen Suen
Ranch Hand

Joined: Oct 30, 2003
Posts: 34
Hi, all,

When a method need return an object list as result, I notice that two implementations exist in JDK. Some take java.util.Enumeration as return type (java.sql.DriverManager.getDrivers), and some take arrays (java.awt.Container.getComponents) instead. Of cource, other choices also there, for example, java.util.Iterator, etc. But, here, my question is on Enumeration and array: I wonder whether there's any resonable consideration when determining which is the appropriate return type?

Any advice will be appreciated.

Stephen Suen
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Intermediate forum...
[ July 08, 2004: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enumeration or Array as return type
 
Similar Threads
byte array as a parameter in JasperReports
deviation in the return type of getParameterValues() method
Did you see this ?StringTokenizer
Enumeration or Array as return type
query