aspose file tools
The moose likes Beginning Java and the fly likes setting a string from a Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setting a string from a Vector" Watch "setting a string from a Vector" New topic
Author

setting a string from a Vector

Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
I am trying to do:



but it keeps giving me the error:



can you not pull a string from a vector and put it into another string?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24189
    
  34

There's no method "getString()" or "getString(String)" in Vector. If item 27 in a Vector is known to be a String, you can say

String temp = (String) names.get(27);

But I'm not sure what you're trying to do with the String "employee_name"; is that intended to be an argument to a method of some object that's in the Vector?


[Jess in Action][AskingGoodQuestions]
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
i am trying to compare two objects from seperate methods.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24189
    
  34

Originally posted by Patrick Mallahan:
i am trying to compare two objects from seperate methods.


If you can explain in a little more detail what exactly is in the vector, and what you want to do, I'm sure we can help you figure this out.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setting a string from a Vector