Package java.util

Examples of java.util.Vector.capacity()


        System.out.println(v);
        final Vector v2 = new Vector();
        //v2.ensureCapacity(60);
        for (int i=0; i<100; i++){
            v2.add(i);
            System.out.printf("size=%d capacity=%d\n", v2.size(), v2.capacity());
        }
        v2.trimToSize();
        System.out.printf("size=%d capacity=%d\n", v2.size(), v2.capacity());
    }
   
View Full Code Here


        for (int i=0; i<100; i++){
            v2.add(i);
            System.out.printf("size=%d capacity=%d\n", v2.size(), v2.capacity());
        }
        v2.trimToSize();
        System.out.printf("size=%d capacity=%d\n", v2.size(), v2.capacity());
    }
   
    public static int giveSome(){
        throw new UnsupportedOperationException(":(");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.