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

The following are Jave code examples for showing how to use ensureCapacity() 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.
+ Save this method
Example 1
Project: jdk8u-jdk   File: EnsureCapacity.java   View Source Code 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   View Source Code 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());
}