Results 1 to 5 of 5
  1. #1
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default How to convert the Vector object into an array?

    How to convert the Vector object into an array?

    e.g.
    Vector<Integer> a = new Vector<Integer>();
    How to convert a into int array?

    Thanks a lot in advance!:D

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  3. #3
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default

    Yes. But there is nothing for conversion between objects and arrays.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Oh, I see, you want an int array, not an Integer array. You'll have to solve this the old fashioned way with a for loop.

  5. #5
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

Similar Threads

  1. Convert a vector to a string array
    By orchid in forum New To Java
    Replies: 4
    Last Post: 02-24-2010, 03:31 AM
  2. How can I cast object to Vector?
    By batya in forum AWT / Swing
    Replies: 2
    Last Post: 11-19-2009, 06:02 PM
  3. Passing a Vector object to a function
    By evapisces in forum New To Java
    Replies: 4
    Last Post: 09-27-2008, 04:18 AM
  4. Search a object in a vector
    By TalhaS in forum New To Java
    Replies: 2
    Last Post: 04-30-2008, 03:05 PM
  5. URGENT: Sorting a vector of object by an element
    By doobybug in forum New To Java
    Replies: 1
    Last Post: 03-12-2008, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •