We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you please explain me, What am I missing here?
In the code file CompositeIterator.java @ https://github.com/bethrobson/Head-First-Design-Patterns/blob/master/src/headfirst/designpatterns/composite/menuiterator/CompositeIterator.java
Line number 13 has a if condition if (hasNext()) { It also returns null in case it doesn't have hasNext()
if (hasNext()) {
In order to traverse through the Menu and MenuItems I had to remove that If condition. You can see the code @ https://github.com/VikramShetty/Fundamentals/blob/master/IteratorAndComposite/CompositeEnumerator.cs
You will find the commented code from line 19th in the above file.
So my question is why is the code not recursively walking the object hierarchy when I have that If condition in my code.
Thanks in Advance. Waiting for your reply. Vikram
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Can you please explain me, What am I missing here?
In the code file CompositeIterator.java @ https://github.com/bethrobson/Head-First-Design-Patterns/blob/master/src/headfirst/designpatterns/composite/menuiterator/CompositeIterator.java
Line number 13 has a if condition
if (hasNext()) {
It also returns null in case it doesn't have hasNext()
In order to traverse through the Menu and MenuItems I had to remove that If condition. You can see the code @ https://github.com/VikramShetty/Fundamentals/blob/master/IteratorAndComposite/CompositeEnumerator.cs
You will find the commented code from line 19th in the above file.
So my question is why is the code not recursively walking the object hierarchy when I have that If condition in my code.
Thanks in Advance. Waiting for your reply.
Vikram
The text was updated successfully, but these errors were encountered: