Вы находитесь на странице: 1из 1

Method Overloading

Method Overriding

1. Happens in the same class

Happens among two classes a super class and a subclass

2. No inheritance

Happens in inheritance only

3. One method does not hide another

Subclass method hides super class method

4. Should have different parameters

Should have same parameters

5. Return type is not bothered

Should have the same return type

6. Leads to static binding and static

Leads to dynamic binding, dynamic polymorphism and dyn

polymorphism

dispatch

Вам также может понравиться