Charlie.java
public class Charlie {
private int a = 5;
protected int b = 7;

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

}

Delta.java
public class Delta extends Charlie
{
private int c = 9;

public void info()
{
System.out.println("Dipanggil pada = " + this.getClass().getName());
System.out.println("b = "+b);
System.out.println("c = "+c);
}
}

Echo.java
public class Echo {


public static void main(String[] args) {
Charlie obj1 = new Charlie();
obj1.info();
Delta obj2 = new Delta();
System.out.println("");
obj2.info();

}
}
Diposting oleh UntarA pRatama

0 komentar:

Visit the Site
MARVEL and SPIDER-MAN: TM & 2007 Marvel Characters, Inc. Motion Picture © 2007 Columbia Pictures Industries, Inc. All Rights Reserved. 2007 Sony Pictures Digital Inc. All rights reserved. blogger templates