The use of the vector of Java

Source: Internet
Author: User
Tags addall

Use of the vector of Java (i):

Generally in the need to have a number of elements in a collection of time to use, to help the document, read the words to take it, should be able to meet you.

Java.util class Vector<e>boolean Add (E o)

Appends the specified element to the end of this vector.

void Add (int index, E Element)

Inserts the specified element at the specified position in this vector.

Boolean AddAll (collection<? extends e> c)

Appends all elements in the specified Collection to the end of this vector, appending the elements in the order returned by the iterator of the specified collection.

Boolean addall (int index, COLLECTION<? extends e> c)

Inserts all the elements in the specified Collection into this vector at the specified location.

void AddElement (E obj)

Adds the specified component to the end of this vector, increasing its size by 1.

int capacity ()

Returns the current capacity of this vector.

void Clear ()

Removes all elements from this vector.

Object Clone ()

Returns a copy of the vector.

Boolean contains (Object elem)

Tests whether the specified object is a component in this vector.

Boolean containsall (collection<?> c)

Returns true if this vector contains all the elements in the specified Collection.

void Copyinto (object[] anarray)

Copies the component of this vector to the specified array.

E elementat (int index)

Returns the component at the specified index.

Enumeration<e> elements ()

An enumeration that returns the components of this vector.

void ensurecapacity (int mincapacity)

Increase the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity parameter.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.