*
The moose likes Beginning Java and the fly likes referencing an  Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "referencing an  Array" Watch "referencing an  Array" New topic
Author

referencing an Array

Jim Rock
Ranch Hand

Joined: Mar 20, 2001
Posts: 39
Can you have a space between the array index and array name
for example are both the following references legal (assuming the array has been declared and constructed):
x[25] = 1;
x [25] = 1;
Rick Rodriguez
Ranch Hand

Joined: Jun 02, 2001
Posts: 44
Jim,
As I mentioned in your previous post, in your example above, the Java compiler does not care about the spaces you place before the open bracket.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Jim
Not to be rude, but instead of asking these types of questions you should write a little code and test it. You'll probably get a faster answer and you'll also get more practice that way too..
Dave


Dave
Jim Rock
Ranch Hand

Joined: Mar 20, 2001
Posts: 39
Dave I was pretty sure I knew the answer. However, my understanding of this bulliten board is that it is for posting questions that have general interest. I think this question was worth having others see.
Originally posted by Dave Vick:
Jim
Not to be rude, but instead of asking these types of questions you should write a little code and test it. You'll probably get a faster answer and you'll also get more practice that way too..
Dave

 
 
subject: referencing an Array