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 JQ+ (Question ID :957924283850) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "JQ+ (Question ID :957924283850)" Watch "JQ+ (Question ID :957924283850)" New topic
Author

JQ+ (Question ID :957924283850)

sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
Question ID :957924283850
What will the following program print ?
class Test
{
public static void main(String[] args)
{
int i = 4;
int ia[][][] = new int[i][i = 3][i];
System.out.println( ia.length + ", " + ia[0].length+", "+ ia[0][0].length);
}
}
Can anyone help me to explain this?
sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
i'm very sorry!! i posted to wrong forum. Can anyone help me to tansfer it to Programmer Certification Study. Thank You.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
done
4, 3, 3
You should try to run it and then if you still don't get what the program does you ask your question...
Moreover the code you posted is explained at the following link: JLS 15.10.2 Example: Array Creation Evaluation Order
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
[This message has been edited by Valentin Crettaz (edited December 17, 2001).]


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
Hi Valentin,
Thank you for helping me. I'm understand multidimension array already. Thank You!

 
wood burning stoves
 
subject: JQ+ (Question ID :957924283850)