Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multidimentioanl Array

 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does Really Java Support Multidimentional Array.
If not then How it handles Multi dimentional Array.

Ramesh
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, a two dimensional array is a one dimensional array of references to one dimensional arrays. As a result, each row can be a different length.
[ November 17, 2004: Message edited by: Mike Gershman ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's cool how you can take a multi-dimensional array apart.

Since gameBoard is an array of arrays, I can pull out one of those arrays, work with it, replace it, etc. I put back a new row with a different length. That may make the game very hard to play I've seen some people call this a "non-rectangular" array.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic