public class overload1 {
public Object show()
{
return "0";
}
}
class overload2 extends overload1{
public String show(){
return "1";
}
}
Override. You are extending the class, and overriding the superclass method.
Overload would look like this:
public class overload1 {
public Object show()
{
return "0";
}
public Object show(Object arg) // Same method name, but different arguments.
{
return "0";
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With