• Post Reply Bookmark Topic Watch Topic
  • New Topic

a for loop is locking up my program  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program with a few functions and it works fine, but then I add a for loop to fill an array and I have tried adding this to *two* separate programs and it causes it to hang







It's just a for loop that I copied and pasted from the web on how to fill an array using a for loop. What am I doing wrong?
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this does not do what you think it does. you just need

read this
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dick Hammer wrote:. . . I copied and pasted from the web on how to fill an array using a for loop. What am I doing wrong?
Where did you find it? We would like to laugh at it, or avoid it
 
Dick Hammer
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LOL Campbell. Thanks Fred. I guess I made a pretty nifty infinite loop.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!