how can i convert vector int to array int if i have integer element???if()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Matias
    New Member
    • Dec 2010
    • 1

    #1

    how can i convert vector int to array int if i have integer element???if()

    Code:
    Vector v = new Vector();
    Vector n = new Vector();
    
    System.out.print(" ");
    w = input.nextInt();//this is for receiving the width
    System.out.print(" ");
    h = input.nextInt();//this is for receiving the height
    
    v.addElement(w);
    n.addElement(h);
    Now How Can I convert the element of my vector to array in integer format???

    Please Help!!
    Tnx a lot!...
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    Try using toArray() function which is provided by vector class.

    Code:
    Vector v = new Vector();
    v.add(1);
    v.add(5);
    Object[] inte = v.toArray();
    Regards
    Dheeraj Joshi

    Comment

    Working...