How to set and get vector value?

Posted on 2009-02-13
Medium Priority
Last Modified: 2013-11-24

If an object has 10 parameters, how to set them to a vector and how to get them from that vector?

Is there any full code example?
Question by:techques
  • 2
LVL 19

Expert Comment

ID: 23638557
you want to set the whole object as one into vector or you want to set the 10 individual parameters into the vector??

Author Comment

ID: 23638581
Dear Sir

The case is that:

I need to compare the parameters values of 2 vector objects.
vector ObjA - age=2*15, gender=3*1, job=1*20, sport=4*6, color=2*12
vector ObjB - age=2*8, gender=3*12, job=1*15, sport=4*13, color=2*7

1) How to set the age, gender, job, sport, color values to vector objects?
2) How to get them?
3) How to compare the age, gender, job, sport, color values of vector ObjA and ObjB?

What is the difference of set the whole object as one into vector AND set the 10 individual parameters into the vector?
LVL 19

Accepted Solution

Kuldeepchaturvedi earned 150 total points
ID: 23638607
I have replied the explanation to your thread, bascially a Vector is not the best form for you to have here..

a Hashtable or HashMap is better because it can store a Key, Value pair, while a Vector can not.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question