Can overloaded methods in derived class hide the same name methods (with different signature) in base class?
When methods are defined with the same name, but different signature, they are just name overloading, nothing can hide anything else. It is irrelevant it is in a derived class or not. • American people drive on the right side. • You are right on this topic. • He will be right back. English word right is overloaded here, we understand the difference by the context. Compiler understands the method overloading by the signature, which serves the same purpose as context, but more reliable, since compiler is not as intelligent as you are. If derived class (subclass) defines a non-private method with the same name and same signature as the non-private method defined in base class, then it is method overriding, polymorphism comes into play. Late binding/Runtime binding will happen.Never mix these two words overriding and overloading, please.
Related Questions
- Can derived class override some but not all of a set of overloaded virtual member functions inherited from the base class?
- Can overloaded methods in derived class hide the same name methods (with different signature) in base class?
- At designtime, how can I hide a base class property in my derived control from the user?