You can overload the operator in C ++, but not in Java. I wonder if you meant method overloading and method overriding? Method overloading has two definitions for the same method signature. For example,
int sum(int var1, int var2) { return (var1+var2); } int sum(int var1, int var2, int var3) { return (var1+var2+var3); }
In object-oriented programming, you redefine (redefine) a function that is inherited from the upstream (base) class. In a class hierarchy, when a function (method) in a subclass has the same name and type signature as the method in its superclass, then it is considered that the method in the subclass overrides the method in the superclass.
haberdar
source share