Re: How does e.hasMoreElements() and e.nextElement() in Enumeration Interface works without definition?
Posted By:
Robert_Lybarger
Posted On:
Saturday, March 31, 2007 09:02 AM
Because "v.elements()" returns a concrete object which implements the Enumeration interface. You are transparently calling those methods on the concrete object, but instead of having to know exactly what the class name of that object, you simply treat it as though it were of interface-type "Enumeration." See also polymorphism.