File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversion of Vector() to string

 
Priya mathi
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
I am storing names which is in array in a Vector() object.
but after that i want to convert that Vector() back to String
i tried using toString(),
but it gives error as wrong arguments.
Is there a way
 
Michael Hildner
Ranch Hand
Posts: 297
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vectors store their data as Objects only, so you have to cast back to the object type that you want.
To retrieve you String object, use something like:

This would retrieve the String object that is the first element in the Vector. Vectors, like arrays, are zero-based.
Hope this helps,
Michael
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic