Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting a string from a Vector

 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to compare two objects from seperate methods.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic