Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can overloaded methods in derived class hide the same name methods (with different signature) in base class?

0
Posted

Can overloaded methods in derived class hide the same name methods (with different signature) in base class?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123