Jumat, 30 Desember 2011

tugas algoritma modul 11

public class StrBuf

{
            public static void main (String args[])

            {
            StringBuffer sbuf = new StringBuffer(25);

            System.out.println("Isi: " + sbuf.toString());
            System.out.println("Kapasitas : " + sbuf.capacity());
            System.out.println("Panjang   : " + sbuf.length());
            System.out.println("");
            sbuf.append("Selamat ");

            sbuf.append("Belajar Java");
            System.out.println("Isi: " + sbuf.toString());
            System.out.println("Kapasitas : " + sbuf.capacity());
            System.out.println("Panjang   : " + sbuf.length());
            System.out.println("");
            sbuf.delete(7,20);

            System.out.println("Isi: " + sbuf.toString());
            System.out.println("Kapasitas : " + sbuf.capacity());
            System.out.println("Panjang   : " + sbuf.length());
            }
}

0 komentar:

Posting Komentar

Statistik

Translate

Blog Archive