How to set and get vector value?

Posted on 2009-02-13
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
    LVL 19

    Expert Comment

    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

    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

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Title # Comments Views Activity
    struts spring hibernate example 12 58
    centeredAverage challenge 8 89
    no14 challenge 14 46
    count8 challlenge 13 67
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    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.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now