I have a method in super class
protected int discount(int amount)
and a method in subclass
protected int discount(int amount1)
Is the method in subclass is going to overload or not???
I have a method in super class
protected int discount(int amount)
and a method in subclass
protected int discount(int amount1)
Is the method in subclass is going to overload or not???
No, method overloading works if you have different type or number of arguments. variable names don't matter
(Excepting your misuse of terminology.) In Java, if you have a function in a sub-class that is identical in name, parameters and (loosely), the return type to a function in the super-class then objects of the sub-class type will use the function in the sub-class. This is called function overriding. (And in Java, unlike C++, is automatic).
(Function overloading is used to describe functions that have identical names but differing parameters.)