File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested Loop Control

 
Pete Tyo
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jas Oberai
Ranch Hand
Posts: 231
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try to print out as many values,so that you see wats taking place.I've reduced the limits of both the loops to 5,for readibility,just run this example and try to understand how the loop follow takes place:

Hope that helps..thanks!!!
 
Pete Tyo
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, those print statements sure help out alot. I understand it now. For each one time the outside loop runs the inner loop will run 5 times. So basiclly I can multiply the number of times the outerloop runs by the number of times the inner loop runs to figure out how many times the inner loop will run. If that makes sense.. Thankyou for your help.

Thanks,

Pete
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic