May 24, 2012 · 10:14 pm
Abstract method |
Virtual method |
1) Abstract method doesn’t have any body defined. |
1) Virtual method have their body defined otherwise it will give compile-time error message “<VirtualMethod()> must declare body because it is not defined abstract, extern, or partial. |
2) Mandatory to implement them. |
2) Not mandatory to override them. |
3) They can be defined in abstract classes only. |
3) They can be defined in any instance class. |
Like this:
Like Loading...
Related
Filed under .Net, C#
Tagged as abstract, virtual