This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes doubt on Enumeration interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "doubt on Enumeration interface" Watch "doubt on Enumeration interface" New topic
Author

doubt on Enumeration interface

lhari krishna
Greenhorn

Joined: May 17, 2007
Posts: 5
hello all,
elements() of vector class returns Enumeration object,but where as this class is not implementing Enumeration interface.But i have seen the follwing statements in a ppt searched on net.
"An object that implements the Enumeration interface generates a series of elements, one at a time. "
How an object is providing implementation for methods in Enumeration Interface

Thank you,
hari krishna
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

It's using an inner class that implements Enumeration but is not available in the API.

This sort of thing happens all the time. Methods that return interfaces or abstract classes use some implementation of those interfaces or subclass of those abstract classes that can be instantiated, then return an instance of those classes.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: doubt on Enumeration interface