seshu,
in your first code snippet, I don't see the definition of method in neither the Parent class nor the Child class. therefore, the method from the
Test class is invoked depending on the argument type.
The general rule for dynamic method lookup is that the method invoked, depends on the class of the reference, and not its compile-time type. Had you had a definition of method in both your Parent and Child classes, then dynamic binding will go to work and will call the methods from appropriate classes.