wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes defining arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "defining arrays" Watch "defining arrays" New topic
Author

defining arrays

javi cervera
Greenhorn

Joined: Jan 17, 2002
Posts: 16
I don�t know how can i define multi dimensional array and fill in the same line:
int a[] = new int [] {2,3}; // ok one dimension
but with two dimensions ??

Thanks in advanced
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Here is an example from Bruce Eckel (Thinking in
Java) Book:
int[][] a1 = {
{ 1, 2, 3, },
{ 4, 5, 6, },
};
Thanks
Barkat
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: defining arrays