Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

question about adding to a vector

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to read in the employee name that is enter from the user and store it to a vector. I have tired it and its under the employee case. All the examples are with data that is already put in to a vector.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should familiarize yourself with the Java API documentation. You can easily look up the answers to such questions. For example, if you look at the docs for the Vector class, you will see that you an use the add() method (Sorry, the board wouldn't let me link directly to the method since the URL has parenteses in it. You can just scroll down the page above to find it.) to append elements into a Vector. It takes a single argument which is the Object you wish to add. For example:

The Objects can also be reference variables:

You should be able to adapt these examples to fit your particular situation.
HTH
Layne
[ April 29, 2003: Message edited by: Layne Lund ]
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic