This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Iterator  RSS feed

 
meeta gaur
Ranch Hand
Posts: 305
Notepad Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It compiles and execute perfectly without any output.

Why doesn't it throw any Exception ? neither iterator() nor hasNext() have any problem ?
 
Stephan van Hulst
Saloon Keeper
Posts: 6973
109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think myList is null? What makes you think iterator is null?
 
meeta gaur
Ranch Hand
Posts: 305
Notepad Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:What makes you think myList is null? What makes you think iterator is null?


Sorry that is not null but empty.I did never iterate empty collection so got confused.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!