Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes Enumeration interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Enumeration interface" Watch "Enumeration interface" New topic

Enumeration interface

Vijay pillai
Ranch Hand

Joined: Jan 10, 2001
Posts: 45
I would like to know about the interface Enumeration.
since Interfaces has methods which are abstract(not defined).
how is it that we find this code running.
Enumeration e=//+a code that returns Enumeration object.
my doubt is .how could we call the undefined methods of the Enumeration interface without declaring it in any way.
pls help.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
This is the whole point of interfaces. By using the interface Enumeration, you are indicating that you don't care which actual class the object returned is an instance of, only that it implements Enumeration.
Consider the following code sample:

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Enumeration interface
jQuery in Action, 3rd edition