When i am calling the method on the child class's object the method is availble via inheritence. and here when it tries to access the variable the object in the variable obj1 of the child class should be accessible since the instance is that of child class.
Overriding (
polymorphism) applies to methods -- not to instance variables. Since the method you are calling is a method of the base class, it uses the instance variables of the base class -- which has not been assigned in your example.
Henry