Method Overriding is - - accessing properties and behaviour of Parent Class. - Use of Virtual and Override keywords. - Executed runtime, also called dynamic Polymorphism. Method Overloading is - - defining method of same name with different parameters in same class. - static method, executed compile time, also called static polymorphism.
method overloading is defining methods with same name in the same class with different parameters. this will be executed during the compile time-Static polymorphism Method Overriding is overriding parent class methods in child class with same name and same parameters. this will be executed during run time- Dynamic Polymorphism
Method overriding is nothing but accessing parent class method in child class with its own properties or variables , where as method overloading is nothing but declaring same method with different parameters multiple times for the same purpose in a class
Method Overriding is -
- accessing properties and behaviour of Parent Class.
- Use of Virtual and Override keywords.
- Executed runtime, also called dynamic Polymorphism.
Method Overloading is -
- defining method of same name with different parameters in same class.
- static method, executed compile time, also called static polymorphism.
Great video
Thanks
Sir, please make a detail video on Dynamic Apex Schema.
method overloading is defining methods with same name in the same class with different parameters. this will be executed during the compile time-Static polymorphism
Method Overriding is overriding parent class methods in child class with same name and same parameters. this will be executed during run time- Dynamic Polymorphism
Method overriding is nothing but accessing parent class method in child class with its own properties or variables , where as method overloading is nothing but declaring same method with different parameters multiple times for the same purpose in a class