Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

two dimensional array into vector  RSS feed

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,,

How to represent two dimensional array in vector?

Thanks in Advance,
Thanvi,
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> How to represent two dimensional array in vector?

define a 'two dimensional array' and the answer will stand out
 
Marshal
Posts: 60759
189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Marshal
Posts: 60759
189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, I think this is not the correct forum for this thread. I presume Maneesh or Rob will move it.
 
Sheriff
Posts: 21502
96
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!