Why do we need to explicitly define a method as virtual and then also specify override in C# to accomplish method overriding whereas the same thing is achieved without using both of these in keywords in Java. What purpose does it serve?
in java, there's no need to add any keyword to override a method. But some rules apply:
font
This way you have tighter control over what's overrideable or not. It's the same as in access permissions - do you give a user all rights by default and remove permissions, or do you give none and then add what's required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With