This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Implementatoion of hasMoreElemnts()??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Implementatoion of hasMoreElemnts()???" Watch "Implementatoion of hasMoreElemnts()???" New topic
Author

Implementatoion of hasMoreElemnts()???

Satish Kumar
Greenhorn

Joined: Mar 13, 2000
Posts: 13
The hasMoreElements is declared in Enumeration interface.
Since it is in an interface, there is no implementation.
We make use of this method and nextElement() in our programs.
We don't give the implemetation for these 2 methods.
Where is the implementation given for us?


Satish Kumar
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
The implementation will be provided in a class hidden from the users of the interface.This is the beauty(or bad side, as u see it)of OOP in which u can easily use the features of an object without worring how a call to that object is going to behave.
Correct me if I am wrong.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
FYI, Enumeration interface should only be used to support code prior to jdk ver 1.2. If you are codeing a new application/applet. Spend to time to use and learn the Iteration interface. It is not only easier to use but more efficient as well. One the the benefits of 1.2 are the enhancement to the
set (or) list processes. Read your documentation and/or TIJ (Think In Java) for more informaiton.
Hope this helps, Monty
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Implementatoion of hasMoreElemnts()???
 
Similar Threads
collection interface and other interfaces
Generic
Types of Inheritance
Calling a method on Connection interface
Quotes