Scenario 1:
What if we pass null
in constructor of a class and we have an overloaded constructor taking Object
and second constructor having String
as argument
Scenario 2 :
What if we pass null
in constructor of a class and we have an overloaded constructor taking Integer
and second constructor having String
as argument and third constructor has Object
as argument
Scenario 3 :
What if we pass null
in constructor of a class and we have overloaded constructor taking Exception
and second constructor having ArithmeticException
as argument and third constructor has Object
as argument
Answer to case 1 String
Answer to case 2 Compiler error , Ambiguous methods
Answer to case 3 ArithmeticException
Please explain me the logic behind the above answers