Start learning 50% faster. Sign in now
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.
A man travels some distance at a speed of 16 km/hr and returns at a speed of 8 km/hr. If the total time taken by him is 3 hrs 45 min, the distance is
What is the length of the bridge which a man riding 21 km an hour can cross in 3 min.?
The speed of a bike increases by 3 km/hr after every 1 hour. If the distance travelled by the bike in 1st hour is 25 km, the find the total distance tra...
A bus starts running with the initial speed of 6 kmhr and its speed increases every hour by certain amount. If it takes 14 hours to cover a distance of ...
‘A’ and ‘B’ started moving towards each other at same time with a speed of 25 km/hr and 15 km/hr, respectively. If the distance covered by ‘Aâ...
A man running with the speed of 45 km/hr covers a certain distance in ‘x’ hours. If the same distance can be travelled with a speed of 50 km/h in (x...
Train P starts from Lucknow to Dehradun at 11:55 am with an average speed of 22.5 m/s. Train Q starts from Dehradunto Lucknowat 1:35 pm with an average ...
The two places are 60 km apart. A and B start walking towards each other at the same time and meet each other after 6 hours. Had A traveled with 2/3rd o...
A circular track has a radius of 140 meters. A person starts running from a point on the track and runs 3 complete rounds. What is the total distance co...
X started to run from point ‘A’ to ‘B’ at a speed of 28 km/hr at 9:00 am and Y started to run from point ‘B’ to ‘A’ at a speed of 12 km/...