• 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?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!