Just wondering if any method we can use to translate a vector to an array (without looping thru the vector and assign the array one by one)? Thank you.
Regards,
Janice
-
How do we translate a Vector to an array? (2 messages)
- Posted by: Janice Wong
- Posted on: October 23 2000 13:36 EDT
Threaded Messages (2)
- How do we translate a Vector to an array? by bharat nagwani on October 23 2000 14:42 EDT
- How do we translate a Vector to an array? by Filip Hanik on October 24 2000 14:27 EDT
-
How do we translate a Vector to an array?[ Go to top ]
- Posted by: bharat nagwani
- Posted on: October 23 2000 14:42 EDT
- in response to Janice Wong
Use the toArray method of the Vector, which will return an array of Object(s) -
How do we translate a Vector to an array?[ Go to top ]
- Posted by: Filip Hanik
- Posted on: October 24 2000 14:27 EDT
- in response to bharat nagwani
Vector v = new Vector();
v.addElement("Filip");
v.addElement("Hanik");
String[] result = new String[v.size()];
v.copyInto(result);
return result;
Filip