• Post Reply Bookmark Topic Watch Topic
  • New Topic

who is providing the implementation for Enumeration Interface methods?  RSS feed

 
Sudhakar Reddy Kurakula
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I was asked in an interview regarding Enumeration methods implemntation.

while(enum.hasMoreElements())
{
Strign s=(String)enum.nextElement();
}
They asked who is providing implementation for these methods?
I told that the provider of JDK.

is it true or not?
please give me answer

cheers
Sudhakar
 
suji kumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Implementation is the responsibility of concrete iterator, provided by the aggregate object
 
Sudhakar Reddy Kurakula
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello please explain me clealy .
I could not understand concrete iterator and aggregate object.
 
suji kumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The colloection oject like Vector, ArrayList are called Concrete Aggregator. This Object gives handle of Concrete Iterator which is of type Enumeration when you ask for Enumeration . And all the implementation of methods(like hasElement(), next() )are written in this Concrete Iterator Object
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"panther club",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!