Java Method Overloading V/s Method Overriding

Mobile Apps Category (English)728x90

Java Method Overloading V/s Method Overriding

Method Overloading and Overriding is different concept but looking similar almost. Here is all points which can differentiate Java Overloading and Java Overriding.

Java Application V/s Java Applet


Method Overloading

Method Overriding

Overloading allows programmer to use different functionalities to a same named method. Overriding allows programmer to add other functionalities to its method is classes.
It occurs when two or more method have same name with different signature. Overriding occurs when a class declares a method that has same type of signature.
It is used in java program frequently because it allows using the same name for group of method that basically has same purpose. Overriding is a compatibility of java program because each overridden method has provided for unique implementation.
Java complier issues on error message because it is unable to determine which form to use. Java compilers issues an error message it method overrides another method has different return type.
It allows easy handle to default parameters. It uses super class reference to “super class” object.
It can occur within a class in different method. Overriding requires super & sub class for different method.
Constructor can be overloaded. Constructor can’t be overridden.

Don’t forget to check Introduction to Java Class and Object.

Personal Development Category (English)728x90

Leave a Reply