• Post Reply Bookmark Topic Watch Topic
  • New Topic

differences between java and c++ in for loop  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i would like to ask what are the code differences between c++ and java regarding for loop, (need it for my report ). example:
for (i=0;i<10; i++) {
statements;
}
i dont see anything different, some help please, all similarities are accepted too.
 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no differences as far as I remember.
Java offers a short-hand for-loop which is very convenient for arrays.


will print 12,13,14,15.
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there a reason you think they are different?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!