Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

Java Vector to String

How do I convert vector to string? I have a vector in which I store value entered by user. I want to get the value from vector and convert it back to String object.
No votes yet
Share this
1 answer
ankitagahoi's picture
You can get the element from vector from specific position then convert it to String by calling  toString method or casting object to String.

like this

Vector vec=new Vector();

//assume vector has 10 elements 

//position can be any from 0 to 9.

String value=vec.getElementAt(position).toString();
No votes yet