• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Multidimensional Arrays

 
Ranch Hand
Posts: 246
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Co-ranchers,

I am looking for tutorial(s)/topics/articles on multidimensional arrays. Please suggest. Your help will be highly appreciated.

Thanks,

Naveen Katoch
 
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ask your doubts we will clear that.

Multidimensional array:
Two dimensional array is an array of array.
three dimensional array is an array of array of array.
Sounds scary na!!!

int [][] array=new int[2][2];

array[0]------> will point to another array of size 2.
and another array will be like:
array[0][0],array[0][1]

same applies for array[1];
array[1][0], array[1][1];

declaring and initializing:
int [][] array={{1,2},{2}};
here
array[0]={1,2};
and
array[1]={2};

ask your doubts.
[ December 07, 2008: Message edited by: Punit Singh ]
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


The Sun tutorials have a small section on multidimensional arrays:

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html


Other sources:


http://math.hws.edu/eck/cs124/javanotes3/c8/s5.html

http://www.unix.com.ua/orelly/java-ent/jnut/ch02_09.htm


However, the K&B book does cover multidimensional arrays in detail. It might be worth getting that book:


http://www.amazon.com/SCJP-Certified-Programmer-Java-310-065/dp/0071591060/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1228671522&sr=8-1
 
nav katoch
Ranch Hand
Posts: 246
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much Punit and Santiago. I appreciate it.

Naveen
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic