Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from withmilk.com

 
Jamie Shi
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone tell me why the for clause never gets executed?
<%for(int i=10;i<6;i--)
out.println(i + "<br>");%>

Thanks in advance!
Jamie
SCJP2
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I'm missing something...
The value of i starts with 10. This is not less than 6. The for loop shouldn't execute.
Or are you asking whether the for loop itself is actually reached in the code?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic