//PROGRAM 11-25 class DemoEnsureCapacity2 { public static void main(String[] args) { StringBuffer sb1 = new StringBuffer(); StringBuffer sb2 = new StringBuffer(6); System.out.println("Pada objek sb1"); System.out.println("Kapasitas awal : " + sb1.capacity()); sb1.ensureCapacity(10); System.out.println("Kapasitas setelah diset : " + sb1.capacity()); System.out.println("\nPada objek sb2"); System.out.println("Kapasitas awal : " + sb2.capacity()); sb2.ensureCapacity(4); System.out.println("Kapasitas setelah diset : " + sb2.capacity()); } }