This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Vectors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Vectors" Watch "Vectors" New topic
Author

Vectors

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
Consider String s[][],this is twodimesional array
s[0][0]="vijay" we can store element(by using two for loops,we can store strings with out that also we can ).Like that it is possible to store elements in vector how i can break numbering.
I will give one example.
Vector v =new Vector();
v.add("");here indexing we can't break just like Arrys.
My idea is in two dimesinal array 20 rows are there,and columns
11 ,if you go on adding in vector,it won't break numbering just like array.How it possible.
Bye,
vijay
srinivas acharyulu
Greenhorn

Joined: Aug 03, 2000
Posts: 19
Obviously Vector cannot be equivalent to a twodimensional array. There you have the concept of capacity.As it is being said 20 rows and 11 columns in an array for example, then all the 220 elements have to be added to the vector. And there for retrieving you have to retrieve like say v[i].


D.Srinivas Acharyulu<BR>SystemsEngineer,<BR>WIPRO Technologies,<BR>Hyderabad,India
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Vectors
 
Similar Threads
searching through vectors
can't get JTable(vector, vector) constructor to work
First post - Logic of a simpe java program
Storing an Java object in Access