Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
What is polymorphism in Java?
It is the ability of an object to take on many forms
It is the ability to define multiple methods with the same name but different signatures
It is the ability of an object to hide its implementation details
None of the above
It is used to check if an object is an instance of a specific class or interface
It can be used with primitive data types
It can be used to compare two objects for equality
Polymorphism and inheritance are two different concepts in Java
Polymorphism and inheritance are closely related concepts in Java
Polymorphism is a subtype of inheritance in Java
Static methods can be overridden in Java
Static methods can be overloaded in Java
Static methods can participate in polymorphism in Java
public void print() {}
public static void print() {}
public final void print() {}
Animal
Dog
Mammal
The method name must be the same but the parameter list must be different.
The method name and parameter list must be the same but the return type can be different.
The method name and parameter list must be the same but the access modifiers can be different.
void print(int a, int b)
int print(int a, int b)
void print(String s)
Code reuse
Flexibility
Encapsulation
Simplicity
void print()