This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes about array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "about array " Watch "about array " New topic
Author

about array

Albert Lee
Greenhorn

Joined: Aug 04, 2002
Posts: 18
are "array[][] a;" and "array[] a[];" eqivalent?


Everyday create your history.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
According to JLS 10.2 Array Variables, they are. Just make sure that the "array" type is defined somewhere


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8805
    
    5
Albert -
Yes - they are the same... and from a style perspective:
int [ ] x; and int [ ] [ ] x;
are preferred over:
int x [ ]; or int x [ ] [ ];
which is certainly preferred over the legal but ugly:
int [ ] x [ ];
The reason is trying reading them out loud, from left to right.


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: about array
 
Similar Threads
Printing the index of an array
WA #1.....word association
How could I print names randomly?
Doubt
Another 'Y' game