inheritence 2

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package program;

/**
 *
 * @author Administrator
 */
class mobil3{
    String warna;
    int tahun;

    void isiData1(String warna,int tahun){
        this.warna=warna;
        this.tahun=tahun;
    }
}
public class KlassMobil3166 {
    public static void main(String[] args) {
        mobil3 mbl=new mobil3();
        mbl.isiData1("hijau", 2004);

        System.out.println("isilagi  "+mbl.warna);
        System.out.println("tahun    "+mbl.tahun);
    }
}

0 komentar:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo