469,917 Members | 1,866 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

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

Expand|Select|Wrap|Line Numbers
  1. Vector v = new Vector();
  2. Vector n = new Vector();
  3.  
  4. System.out.print(" ");
  5. w = input.nextInt();//this is for receiving the width
  6. System.out.print(" ");
  7. h = input.nextInt();//this is for receiving the height
  8.  
  9. v.addElement(w);
  10. n.addElement(h);
  11.  
Now How Can I convert the element of my vector to array in integer format???

Please Help!!
Tnx a lot!...
Dec 13 '10 #1
1 4547
Dheeraj Joshi
1,123 Expert 1GB
Try using toArray() function which is provided by vector class.

Expand|Select|Wrap|Line Numbers
  1. Vector v = new Vector();
  2. v.add(1);
  3. v.add(5);
  4. Object[] inte = v.toArray();
  5.  
Regards
Dheeraj Joshi
Dec 13 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by csx | last post: by
3 posts views Thread by news.hku.hk | last post: by
3 posts views Thread by Steven T. Hatton | last post: by
4 posts views Thread by msosno01 | last post: by
3 posts views Thread by Matthias Pospiech | last post: by
8 posts views Thread by Frank Liebelt | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.