Java Code Examples for java.util.Vector.capacity()

The following are Jave code examples for showing how to use capacity() of the java.util.Vector class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: jdk8u-jdk   File: EnsureCapacity.java   Source Code and License Vote up 6 votes
private static void testVector() {
    Vector<String> vector = new Vector<String>();
    vector.add("abc");

    int cap = vector.capacity();
    vector.ensureCapacity(Integer.MIN_VALUE);
    checkCapacity(cap, vector.capacity());
}
 
Example 2
Project: openjdk-jdk10   File: EnsureCapacity.java   Source Code and License Vote up 6 votes
private static void testVector() {
    Vector<String> vector = new Vector<String>();
    vector.add("abc");

    int cap = vector.capacity();
    vector.ensureCapacity(Integer.MIN_VALUE);
    checkCapacity(cap, vector.capacity());
}