AkhmadGhafirin
4/25/2017 - 12:15 AM

Main katak

package polimorfisme;

/**
 * Created by ahmad on 21/04/17.
 */
public class MainKatak {
    public static void main(String[] args) {
        System.out.println("Obyek\t\t|  Umur |\tNama\t\t|\tPanjang Ekor\t|\tCara Bergerak");
        System.out.println("--------------------------------------------------------------------------");
        Katak froggy = new Katak(5, "Froggy");
        froggy.setCaraBergerak("Melompat");
        System.out.println("Katak\t\t|\t" + froggy.getUmur() + "\t|\t" + froggy.getNama() + "\t\t|\t" + "\t\t\t\t|\t" +
                froggy.caraBergerak());

        Kecebong junior = new Kecebong(2, "Junior Frog", 10);
        junior.setCaraBergerak("Berenang");
        System.out.println("Kecebong\t|\t" + junior.getUmur() + "\t|\t" + junior.getNama() + "\t|\t\t" +
                junior.getPanjangEkor() + "\t\t\t|\t" + junior.caraBergerak());

    }
}