This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

defining arrays

 
javi cervera
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example from Bruce Eckel (Thinking in
Java) Book:
int[][] a1 = {
{ 1, 2, 3, },
{ 4, 5, 6, },
};
Thanks
Barkat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic