Core Java Interview questions

Total available count: 646
Subject - Java Technologies
Subsubject - Core Java

Which is an example for Polymorphism: overloading or overriding?

Overloading is an example of polymorphism. Method overloading is an example of static polymorphism. polymorphism means many forms. An important example of polymorphism is how a parent class refers to a child class object.

We have two classes: A child class cat and a parent class Animal. The cat class extends Animal class. Both the classes have a common method void eat(). cat class is giving its own implementation to the eat() method or in other words it is overriding the eat() method.

Next 5 interview question(s)

Can we overload main() method?
Which class is the super class for every class in java?
Can we execute a program without main() method in java?
Can we access clone() method from outside the package in java?
Which Exception is thrown if try to use clone() method with implementing Cloneable interface in java?