} *********************************************************** i dont know y the constructor which has string as argument is invoked when the code is executed.y not the constructor which has object as argument is called since its it is super most class i want to know the reason.plz any help me with regards prasath

hey Jack im fine how abt u. Thank u very much for ur response still im not clear.Actually u told String is in the top of Inheritance but Object is the supermost class.y we need xplicit type conversion to call the object constructor.Actually in java for primitive data type lower data type if want to convert int to short we need to type cast explicitly but in this case it gets reversed thats y i got confused can u provide some more explanation plz help me friend for better understanding with regards prasath

"Actually in java for primitive data type lower data type if want to convert int to short we need to type cast explicitly but in this case it gets reversed thats y i got confused can u provide some more explanation plz help me friend for better understanding"

I've studied Latin and Englis but that didn't help me here. Please use proper punctuation, grammar and spelling so people can understand your questions if you want meaningful answers.

When overloaded functions are called (and constructors too) the one with the arguments that best match the ones supplied is picked. So if you have a class X deriving from Y which derives from Z and you have 3 constructors in class A:

and you then call A a = new A(new X()); it calls A(X). If you had used A a = new A(new Y()); A(Y) would have been called. Now if you have Z x = new X(); A a = new A(x); it calls A(Z) because you call it with a Z not an X. Had you used A a = new A((X)x); it would have used A(X) instead as expected.