Java Method Overloading V/s Method Overriding

Java Method Overloading

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.

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative