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.
How many pairs of digits are there in the number '296438579', which have as many digits between them (both forward and backward) as there are between th...
Given below are four combinations [i], [ii], [iii] and [iv] of five words. In each combination you have to arrange the letters in English alphabetical o...
Each consonant of the word ‘TRANSMITTED’ is changed to the previous letter in the English alphabetical series and each vowel is changed to the next...
If we increase each even digit by 1 and decrease each odd digit by 1 in the number "8753652846" and then arrange all the digits in ascending order, then...
The positions of how many alphabets will remain the same if each of the alphabets in the word DOCUMENT is rearranged in the alphabetical order from le...
In the given words, if the 3rd and 6th (from the left end) letters are exchanged and same is done with 4th and 9th...
How many pairs of letters are there in the word "SUITCASE" which has as many letters between them (in both forward and backward direction) in the word ...
How many pairs of letters are there in the word “CORPORATION” which has as many letters between them in the word as in the English alphabetical seri...
Four of the following five are alike in a certain way based on their position in the above arrangement and so form a group. Which one of the following ...