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.
The city had been quarantined by ___ government authorities for months, leaving its inhabitants isolated and uncertain about ___ future.
...- Select the most appropriate option to fill in the blank.
Senior judges of the Supreme Court ___________the morning to discuss the issue.
... The ____________recruit was ready to join the Army and signed up the day he turned eighteen.
Educate your children and let them learn to live with ________.
 (A) elevation      (B) dignity       (C) respect ...
In the question given below, two sentences are given with one blank each. From the given options, choose the word that correctly fits both sentences.
Fill in the blank/s with suitable Word/s:
The chef tried to _________ a new recipe using local ingredients.
You should arrive early to _____ your surroundings.
Directions: In each of the following sentences, a blank is given. Choose the most appropriate option from the provided choices to fill in the blank and...
In the question given below, two sentences are given with one blank each. From the given options, choose the word that correctly fits both sentences.
Cryptocurrencies represent a novel and rapidly _______ form of digital currency that has the ________ to reshape financial systems and transactions.Â