| Author |
local variable count and array[count]: Too Many Variables to Count!
|
Robin Lane
Ranch Hand
Joined: Apr 30, 2008
Posts: 76
|
|
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:
|
Disclaimer: The author of this post makes no claims, implied or otherwise, as to her ability to understand anything but the simplest of answers. Further, the author of this post has no programming background whatsoever and has taken one Java Programming class which was 9 weeks long. She does want to learn, so please teach patiently.
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16815
|
|
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
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Robin Lane
Ranch Hand
Joined: Apr 30, 2008
Posts: 76
|
|
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.
|
 |
 |
|
|
subject: local variable count and array[count]: Too Many Variables to Count!
|
|
|