wood burning stoves 2.0*
The moose likes Java in General and the fly likes two dimensional array into vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "two dimensional array into vector" Watch "two dimensional array into vector" New topic
Author

two dimensional array into vector

thanvi janu
Greenhorn

Joined: Nov 16, 2009
Posts: 29
Hi all,,

How to represent two dimensional array in vector?

Thanks in Advance,
Thanvi,
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> How to represent two dimensional array in vector?

define a 'two dimensional array' and the answer will stand out
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38513
    
  23
Michael Dunn wrote:define a 'two dimensional array'
If only people were taught there is no such thing as a 2D array in the first place.

Look at this Java™ Tutorials page and see what it says when you use ctrl-f "multidimensional".
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38513
    
  23
By the way, I think this is not the correct forum for this thread. I presume Maneesh or Rob will move it.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19684
    
  20

Moving to Java in General.

A multidimensional Vector is nothing more than a Vector of Vectors (of Vectors etc): Vector<Vector<X>>. Unlike with multidimensional arrays* you will need to initialize the inner Vectors manually.


* There actually is no such things. A multidimensional array is also nothing more than an array of arrays (of arrays etc). The only difference with a multidimensional Vector is that multidimensional arrays have a shortcut in syntax for creating them.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Don't get me started about those stupid light bulbs.
 
subject: two dimensional array into vector