I agree with you , but when i change the signature of the constructor to
private Confusing(boolean Array)
it is calling constructor
private Confusing(Object o)
as far as i know null is a special literal rather than an object , then why is it calling this constructor and not the constructor "private Confusing(boolean Array)"
As far as I know, boolean Array[] is an array of boolean variables. The constructor in this case takes a reference to an array of type boolean. A reference can be null So null matches it. It is not the same as boolean where it expects a boolean value.
Hope I have not confused (pun unintended ) things further
now out of these two private Confusing(boolean Array[]) is selected because Object is the super class of the Array object and it is the first to be best fitted.
Now if you change private Confusing(boolean Array[]) to private Confusing(boolean Array) it again becomes a primitive value so a null value cannot fit in this so after this change you get a out put as �Object�..�
Now lets say I add another constructor to the code you have above : private Confusing(String o) { System.out.println("String...."); }
the moment you also add this constructor to this you wont be able to compile the code as the it creates an ambiguity in which you cannot decide as to which constructor is best fitted Confusing(String o) OR Confusing(boolean Array[])
hope this has helped you in understanding the concept. [ March 08, 2006: Message edited by: Amy Medrat ]