I have a doubt in overriding.
class base{
public void amethod(){}
}
class child extends base{
public void amethod(int i){}}
What happens in this case?Are the methods considered 2 different ones?or does it still override?Pls clarify.
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.
This is not overriding, but overloading, and those two are not related to each other.
Take a look at the Java tutorial: