Minggu, 27 September 2009

JAVA = CLASS

KODING 1 ::

class Michael {
private int a=29;

public void info() {
System.out.println("nilai a = "+ a + "\n");
System.out.println("Dipanggil pada = " + this.getClass().getName());
}
}



===============================================================================

KODING 2 ::

class Jackson extends Michael {
private int b=14;

public static void main(String[] args) {
Jackson obj = new Jackson();
obj.info();
System.out.println("");
}
}


OUTPUT ::

0 komentar:

Posting Komentar