Easy learning with example program codes

java interview questions on method overloading and overriding

Method overloading

Method overloading is the way of implementing static/compile time polymorphism in java. Method overloading means more than one methods in a class with same name but different parameters. Parameters can be differing in types, numbers or order. Compiler resolve method call by matching method signature at compile time, that’s why it is known as static or compile time polymorphism. It is also known as static binding.

Method overriding

If a subclass provides a method with the same signature (name and parameter) as in its super class, then subclass overrides the method of its super class. This process of overriding a super class method by subclass is known as method overriding.

Java interview questions on method overloading and overriding

Please follow and like us:

Copyright © 2020 CodesJava Protection Status