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.
- If sec 2P = sin² 60⁰ + sec 60⁰ - cos² 30⁰, then determine the value of (√3tan P + cot² P)
- Find the maximum value of (12sin A + 16cos A).
Find the maximum value of 18 sin A + 7 cos A.
- If tan3θ = 1, then find the value of: (sin² 2θ/sec 3θ + 15°)
- If sin (3A − 2B) = (√3/2) and cos (A + B) = (1/2), where 0° < A, B < 90°, then find the value of ‘A’.
if 8 sin 2 x + 3 cos 2 x = 4 then find tan x
If 0 ≤ θ ≤ 90°, and sin(2 θ +50°) = cos (4 θ + 16°), then what is the value of θ (in degrees)?
if a sin 45 ˚ = b cosec 60 ˚ then find the value of a⁴/b⁴
...Sec A -Tan A = 1/16 then find the value of cot A =?
Find the maximum value of 14 sin A + 24 cos A.