+ 1

To override method , is it compulsory to use override keyword? why we can't override method just like in c++ using same name with different definition.

I wanted to know that in c++ , all is needed to have a same name method with different definition but in c# both method should be declare with override keyword??

9th Sep 2018, 5:29 PM
shiwangee pathak
shiwangee pathak - avatar
2 Respuestas
+ 1
Same name different parameters is overloading. The override is only required when you inherit a method from your ancestor class with the same name and parameters that you wish to change. You can overload that method with different parameters without the override.
9th Sep 2018, 10:18 PM
John Wells
John Wells - avatar
+ 1
thank u sir for helping me.
10th Sep 2018, 5:42 AM
shiwangee pathak
shiwangee pathak - avatar