Question
Which of the following best represents the concept of
polymorphism in Object-Oriented Programming?ÂSolution
Polymorphism in Object-Oriented Programming (OOP) allows methods to be defined in different forms across different derived classes, typically by overriding or overloading methods. This enables a single method to exhibit multiple behaviors, depending on the object that invokes it. For example, a base class method draw() in a shape class could be defined differently in derived classes like Circle and Rectangle, where each class implements its unique version of draw(). This approach promotes flexibility, reduces code duplication, and allows developers to manage code easily as new classes are added, embodying one of OOP’s core principles. Polymorphism is critical for creating extensible and maintainable code, as it enables a system to process objects of various types through a common interface. Option A (Encapsulation) - Encapsulation is the OOP principle of hiding internal details and exposing only necessary features through a class interface, which differs from polymorphism’s focus on varied behaviors. Option C (Aggregation) - Aggregation describes a "has-a" relationship between classes, where one class contains references to another, unrelated to polymorphic behavior. Option D (Encapsulation) - This concept of grouping related fields and methods within a class refers to encapsulation, not polymorphism. Option E (Unrelated Classes) - Allowing objects of unrelated classes to connect without a common functionality does not represent polymorphism, which requires shared interfaces or inheritance.
The national song ‘Vande Mataram’ was composed by Bankim Chandra Chatterjee i n which language?
Which of the following seas has highest salinity in the world?
The missing term of the series isÂ
A2, C5, E8, G11, ____________
Which amongst the following statements is/are not correct ?
1.     Isthmus is a narrow strip of land joining two landmasses.
2. �...
If * is an operation such that a * b = 3a – 4b. find the value of 3*4
Penicillium is a _____________.
The six freedoms in Article 19 can be curtailed by:
New education policy. 2020 is goal to achieve 100% gross enrolment Ratio (GER) in school Education by the year ________.
If the square root of the product of two numbers equals their average, then