This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Iterator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Iterator" Watch "Iterator" New topic
Author

Iterator

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


It compiles and execute perfectly without any output.

Why doesn't it throw any Exception ? neither iterator() nor hasNext() have any problem ?


My one regret in life is that I am not someone else.
- Woody Allen
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

What makes you think myList is null? What makes you think iterator is null?
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iterator