Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
Dog
Animal
Mammal
None of the above
Compile-time Polymorphism
Run-time Polymorphism
Inheritance Polymorphism
Animal animal = new Dog();
Dog dog = new Animal();
Animal animal = new Animal();
Dog dog = (Dog) animal;
final int a;
final void print();
final class Animal {}
All 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
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
Static methods can be overridden in Java
Static methods can be overloaded in Java
Static methods can participate in polymorphism in Java
void print(int a, int b)
int print(int a, int b)
void print(String s)
void print()
Dog d = new Dog(); Animal a = d;
Animal a = new Animal(); Dog d = (Dog) a;
Dog d = new Animal();