This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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: 20894
76
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