Runtime polymorphism

Runtime polymorphism

In this tutorial we will discuss overloading and overriding examples.We are going to learn the tricky part of the polymorphism.

Overriding example:

Which method to call will be determined by the instance of the class.

Here method defined in the superClass will be called.

Method Overloading:Which method to call will be determined by the reference type.
For example in this case

Leave a Reply

Your email address will not be published. Required fields are marked *