• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

local variable count and array[count]: Too Many Variables to Count!

 
Robin Lane
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm struggling with an itty bitty little puzzle. I can't for the life of me figure out exactly what is being referred to in the following code:



 
Henry Wong
author
Marshal
Pie
Posts: 22089
88
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but where does array[counter] come from?


It comes from the first line of the main() method, where you declared the array. Now, since you never set any of the values, they should all have the default value, which for ints is zero.

Henry
 
Robin Lane
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry, thank you so much for answering my question. I have no previous programming experience and Java is a little more abstract than the way I normally think.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic