This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes referencing an  Array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: referencing an Array
 
Similar Threads
Printing out Ascii charactors
MultiDimenaional Array sort
Since when does 25/4 = 6.0?
declaring arrays
Multi-d array