What is method hiding in OOP?

Object Oriented Programming Questions



47 Short 36 Medium 25 Long Answer Questions Question Index

What is method hiding in OOP?

Method hiding in object-oriented programming refers to the concept where a subclass defines a method with the same name as a method in its superclass, thereby hiding the superclass method. This means that when the method is called on an object of the subclass, the subclass method is executed instead of the superclass method. Method hiding is achieved by using the "static" keyword in the subclass method declaration.