The flow order after new is
1) Call the constructor
2) Call Super constructor if any(here parent)
3) Initilize static & instance variables(S = "parent")
4) Execute the statements in the constructor(call to method... This referees the method in the child. Not the method in the Parent.)
So when the method in the child is called the variable "S" is yet to be initilized. So "null" is printed.
If u make the the
string in child as static, then u can have "child" O/p.
Cos static will be loaded at the time of loading the class.
Since the method is overridden in the child class the overridden method will take the higher priority.
Correct me if i'm wrong.
[URL=
Order for Object Creation]
[ July 21, 2006: Message edited by: Barry Gaunt ]