Suppose B extends A
and we have a declaration A a=new B();
What is the use of referencing sub class object by super class variable?And what are the fields and methods accessible by the object a((only child class methods and variables) Or (from both child and parent class))?
Thank u