Because constructor in class A assign a= 20,b= 30 but in class B that is not happen so default value 10 and 20 print. [ March 01, 2008: Message edited by: Prasun Howlader ]
"Control time instead of letting time control you."
Joined: Aug 29, 2007
why the class B doesn't call value of the constructor of class A?
Joined: Sep 19, 2006
Originally posted by rex tony: why the class B doesn't call value of the constructor of class A?
class B does not instantiate an object of class A, so the constructor would never be called. the fields x and y are static, of course, so no instance is necessary when dealing with them as they belong to the class, not any object.