Question
Which of the following best illustrates the concept of
polymorphism in Object-Oriented Programming (OOP)?Solution
Polymorphism in OOP refers to the ability of a function, method, or object to take on multiple forms. This characteristic allows developers to design interfaces or methods that can perform different tasks based on context. 1. Method Overloading: One of the primary examples of polymorphism is method overloading, where multiple methods share the same name but differ in argument types or counts. 2. Dynamic Behavior: Polymorphism also enables dynamic method invocation at runtime, allowing a subclass to provide a specific implementation for a method defined in its superclass. 3. Extensibility: By allowing objects to process different behaviors through a unified interface, polymorphism enhances code flexibility and scalability. Why Other Options Are Incorrect: • B) A class inheriting properties: This describes inheritance, not polymorphism. • C) Combining multiple objects: This relates to composition, which involves creating a complex object from simpler ones. • D) Restricting access: This refers to encapsulation, which controls data accessibility within a class. • E) Relationships between objects: This describes association or aggregation, not polymorphism.
IRF and FRA are over the counter (OTC) instruments to cover interest rate risks
Who is the CEO of Axis Bank?
The National Development Council was set up in:
Which of the following country will host G-20 meeting in 2022?
Who has broken the national record of Javelin Throw at the Paavo Nurmi Games in Finland?
Ismail Haniyeh, who was recently assassinated in Iran, was known as:
Which among the following recently became the first Indian bank to cross the market capitalization of 5 lakh crore?
Consider the following statements with reference to the Charkula dance of Uttar Pradesh:
1. It is a dance performed in the Awadh region of Uttar ...
In the parliamentary dignitaries, which of the following is included?
1. Speaker of Lok Sabha
2. Deputy Speaker of Lok Sabha
3. Gen...
How many operational factories were reported in India’s organized manufacturing sector in FY23 according to the ASI?