File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Array" Watch "Array" New topic
Author

Array

nitin sharma
Ranch Hand

Joined: Feb 24, 2001
Posts: 290
A two Dimensional array of size 2x2 can be declared like this
int[][]x=new int[2][];
What do u think folk's, given option is right or wrong.
Ravindra Mohan
Ranch Hand

Joined: Mar 16, 2001
Posts: 216
Hi Nitin,
You are right a two dimensional can be declared by <code> int[][]x=new int[2][]; // Legal</code>, but <CODE> int[][]x=new int[][2]; // is ILLEGAL </CODE>.
You may like to see the folowing code:

Hope this serves your purpose.
All the best for your SCJP.
Cheers,
Ravindra Mohan
 
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: Array
 
Similar Threads
Array class?
Clarification for such a method
Reference
Trouble with compiling?
aggregate initialization