Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to remove value from a vector (from its top index 0)

807598Jul 25 2006 — edited Jul 26 2006
HI Friends
A basic question. In my code i am adding values in vector (v). Now i want to remove the values from the top of the vector (from index 0) and move them in an variable temp. How can i do it. I know there is a method remove in vector. but i am not sure how to use it.Can anybody show me how to do this?

here is my peice of code
   public void result (){
        int temp1,temp2;
        for(int i=0; i<=  3000;i++){
           v.removeElement(i); 
        }
       }
Thanks alot in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2006
Added on Jul 25 2006
3 comments
161 views