Type Here to Get Search Results !

Which of the following correctly describes the concept of "overriding"?

0

 Which of the following correctly describes the concept of "overriding"?

A) Implementing multiple methods with the same name.
B) Providing a new implementation for an inherited method in a subclass.
C) Calling a superclass method from a subclass.
D) Creating a static method in a subclass.

Answer: B) Providing a new implementation for an inherited method in a subclass.

Explanation: Overriding occurs when a subclass provides a specific implementation of a method that is already defined in its superclass. This allows the subclass to modify or extend the behavior of the inherited method while maintaining the same method signature.

Post a Comment

0 Comments