But according to the book (which is indeed true, as this is what happens). The following action sets all the properties.
From what i have learnt w.r.t to JavaPolymorphism is that a reference variable can invoke (at runtime, through dynamic dispatch) only the methods that it knows about. This means (assume B is subclass of A)
a can invoke methods that are overridden.
a cannot invoke:
methods that are only in B // This is what seems to happen here
methods that are only in A //off course, because the actual object instantiated is of type B.
How then, is personBean able to set empId which is not overridden and which solely belongs to the subclass. Please help. It is not a very encouraging feeling to have when you are thinking about giving SCJP and find your Inheritance fundamentals challenged. Thanks.