wood burning stoves 2.0*
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 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 » 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: 8815
    
    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.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about array