Question
Which of the following is an example of Polymorphism in
Object-Oriented Programming?Solution
Polymorphism allows one interface to represent multiple implementations . This can occur through method overriding , where a subclass provides a specific implementation for a method declared in its parent class, or method overloading , where methods have the same name but different parameters. For instance, an Animal class might have a sound() method overridden in subclasses like Dog or Cat to produce specific sounds. Polymorphism enables flexibility and extensibility, as the same method can be applied differently based on the object. Why Other Options Are Incorrect : 2. A class that inherits properties from another class : This is Inheritance , not Polymorphism. 3. A class that uses another class as a part of its definition : This describes Composition , where objects are combined to form complex systems. 4. A way to restrict access to certain class members : This is Encapsulation , not Polymorphism. 5. A way of dividing a complex system into smaller components : This is closer to the concept of Modularization , unrelated to Polymorphism.
Which of the following country hosts first meeting of Governing Board of BIMSTEC Energy Centre (BEC)?
Where did Uber launch its first water transport service in Asia?
The strategic technology alliance Pax Silica, which India joined to strengthen supply chains for electronics and critical minerals, held its first summi...
How many monuments were illuminated as part of the ‘Ek Desh Ek Dhadkan’ campaign?
Which eminent Indian astrophysicist received the COSPAR Harrie Massey Award 2024?
What new feature does Version 2.0 of the ‘FloodWatch India’ app include?
According to the Perpetual Capital Hurun India Impact 50 (2026) sustainability rankings, which company secured the top position with 53.9 points?
 Which of the following frontier highways is all set to be constructed near the China border by the year 2027 ?
What is the purpose of the Joint Group of Customs (JGC) meetings between India and Bhutan?
- Which indigenous CFD software did VSSC announce for commercial launch?