class Parent {
����String message = "parent";
}
class Child extends Parent {
����String message = "child";
}
public class
Test {
����public static void main(
String[] args) {
��������Parent yo = new Child();
��������System.out.println(yo.message);
����}
}
output of this program is
parent
please clarify the thing why "child" should not be print while object is Child class and reference is Parent class.
Thanks in advance
Arpit