what is difference between overloading and overriding


overloading means when you want to load things or objects with different parameters

overriding means when you want to load things which have same parameters and working on a class.

overriding always needs class inheritance to load a class whereas overloading does not need a class inheritance.

and one more example is as follows

when you have defined different methods and these methods access same class and it does not require any kind of inheritance ; it is called overloading.

above statements show that there is great difference between them.

 in overloading different methods must inherit a class otherwise there would not happen any kind of polymorphism.