Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JQ+ (Question ID :957924283850)

 
sing
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
sing
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Valentin,
Thank you for helping me. I'm understand multidimension array already. Thank You!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic