For the methods:
public void doSomething(mObject1 ob){
//Code A
}
public void doSomething(mObject2 ob){
//Code B
}
Whats the code executed when calling and why?
doSomething(null);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you cannot call doSomething with a null parameter. The compiler will complain. In all other cases the signature of the method is matched.However this would work :