This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes Enumeration Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Enumeration Question" Watch "Enumeration Question" New topic

Enumeration Question

John Lincoln
Ranch Hand

Joined: Feb 11, 2003
Posts: 192

I have class which implements Enumeration interface.

It prints all the elements (there are 3 elements)

But with the following code

The function gets called only once (for one element) ? What is wrong with the above ?

thank you
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61105

Please reserve this forum for questions on advanced Java. I have moved this post to a more appropriate forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Offhand the most likely guess is that children() and breadthFirstEnumeration() return different enumerations. Maybe children() returns only immediate children, and breadthFirstEnumeration() returns grandchildren, etc. as well? Are these two methods supposed to return the same enumeration, or not?

"I'm not back." - Bill Harding, Twister
It is sorta covered in the JavaRanch Style Guide.
subject: Enumeration Question