Showing posts with label Overriding. Show all posts
Showing posts with label Overriding. Show all posts

Java- Difference Between Method Overloading & Method Overriding / Chapter - 8 / OOP's Concept

Method Overloading,Method Overriding Difference between Method Overloading and Method Overriding 



  1. Method Names: - In Overloading method name should be same, And Even In Overriding method name should be same.

  2. Argument Type: - In Overloading, argument type must be different (at least the order of arguments), But in the Overriding argument type must be same.

  3. Method Signature: - In Overloading, method signature must be different, But in the Overriding method signature must be same.

  4. Return Type: - In Overloading, there is no restriction on the return type, But in Overriding return type must be same until 1.4 v, But from 1.5v onwards co-variant return type is allowed.

Java- Method Overriding / Chapter - 7 / OOP's Concept

Method OverridingMethod Overriding in Java


1.In java, whatever method parent class has that method by default available to the child class through inheritance. If the child class is not satisfied with parent class method implementation then child class is allowed to redefine that method based on its requirement, this process is known as "Overriding".


2.The parent class method which is overridden is called overridden method and the child class method which is overriding is called the overriding method.


3.In overriding method resolution is always takes care by JVM based on the runtime object hence overriding is also known as runtime polymorphism or dynamic polymorphism.


Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com