Please don't be annoyed, but I have pulled rank and changed your answer.
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Sachin Tripathi wrote:Avoid using parent and child for super and sub classes,because they have no resemblance to parent or child
The rule about which you are talking about:
Instance(object) of subclass can be assigned to reference variable of its super class (direct or indirect)
Sankalp Bhagat wrote:LMAO
The very first thing, parent class for superclass and child class for subclass I've taken for better understanding. And by the way I've already used A is superclass of B and C.
Sachin Tripathi wrote:First of all ,we expect everyone to not to use abbreviations (LMAO,gotta)
Reason:we are here to simplify things,using such acronyms, abbreviation, slang (whatever they are)won't help our cause
Anything which you feel to be helpful won't be helpful until that is right
So you are not advised to use parent and child
A a=new B();
What will this do