Question
In OOP, which concept allows a subclass to provide a
specific implementation of a method already defined in its parent class?Solution
Method overriding allows a subclass to redefine a method of its parent class to provide more specific behavior. 1. Dynamic Binding: Overriding enables dynamic (runtime) polymorphism, allowing a subclass method to be invoked via a parent class reference. 2. Specialization: It customizes inherited behavior, making objects more precise in functionality. For example, a generic draw() method in a Shape class can be overridden by a Circle subclass to draw circles. 3. Liskov Substitution Principle: Overriding ensures subclass objects can seamlessly replace parent class objects without affecting system behavior. Option C exemplifies OOP’s adaptability and extendability by redefining methods at runtime. Why Other Options Are Incorrect: • A) Encapsulation: Manages data access, unrelated to redefining methods. • B) Method Overloading: Involves multiple methods with the same name but different parameters, unrelated to inheritance. • D) Abstraction: Focuses on defining essential features, unrelated to runtime behavior customization. • E) Composition: Relates to object containment, not method redefinition.
Under which article of the Indian Constitution are village panchayats organized?
The revamped PM SVANidhi scheme has been extended till which year?Â
Which state became the top producer and exporter of processed potatoes in India in 2024–25?Â
What is the primary focus of the MoU signed between DPIIT and HDFC Bank?
By how much has SEBI capped the net intraday position limit per entity in equity index options?Â
Who was awarded the "Education Leader of the Year" at the Education World India School Ranking Awards 2024-2025?
Which financial institution partnered with Tata Power Solar Systems Ltd to facilitate financing options for installing rooftop solar panels and electric...
Dubai launched the “One Freezone Passport” initiative to allow firms to operate in all free zones with:Â
India will host the Shanghai Cooperation Organisation (SCO) Tourism Ministers’ Meeting (TMM) on 17th -18th March 2023 in which of the following city?...
What is the primary focus of AgriHub, the AI-driven Center of Excellence launched by MeitY and IIT Indore?