public class Parent {
protected String value = "parent";
public static void main(String[] args) {
Parent parent = new Child();
Child child = new Child();
System.out.println(parent.value);
System.out.println(child.value);
}
}
class Child extends Parent {
protected String value = "child";
}
Login in to like
Login in to comment