class Parent {
int m;
}
class child extends Parent {
public static void main(String args[]) {
Parent x = new Child();
}
}
What is the meaning when we say x is of type Parent
? Why do we make use of
such referencing while we can use Child x = new Child()
?