How do we translate a Vector to an array?

Discussions

EJB design: How do we translate a Vector to an array?

  1. How do we translate a Vector to an array? (2 messages)

    Just wondering if any method we can use to translate a vector to an array (without looping thru the vector and assign the array one by one)? Thank you.

    Regards,
      Janice
  2. Use the toArray method of the Vector, which will return an array of Object(s)
  3. Vector v = new Vector();
    v.addElement("Filip");
    v.addElement("Hanik");
    String[] result = new String[v.size()];
    v.copyInto(result);
    return result;


    Filip