Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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:



 
author
Marshal
Posts: 23437
138
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
Boost this thread!