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

The tricky for-loop

 
Tommaso Nuccio
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I got this question from javablackbelt.com, John Hunt's exam.
I cannot figure out the point here:


Why does it skip the for loop and prints "Total 0"?

Thanks in advance.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tommaso Nuccio:
...Why does it skip the for loop and prints "Total 0"? ...

"total" is set to zero, and the body of the loop will only execute if total is greater than 30.
 
Tommaso Nuccio
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dang,



I read it "until total is greater than 30".

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