© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
14 replies
Thalnos

✅ Understanding virtual keyword

Hi, I am familiar with inheritance and polymorphism but I struggle to understand the benefit of the virtual keyword. The idea behind the virtual keyword is to be able to provide a default implementation but also being able to possibly override that implementation in inheriting types. But we can do the exact same thing with just regular methods, so does virtual only exist to express clearer intend that methods shall be reimplemented in inheriting types by other developers or what is the purpose of that keyword?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Static keyword
C#CC# / help
11mo ago
var keyword
C#CC# / help
2y ago
❔ `required` keyword
C#CC# / help
3y ago
❔ As Keyword
C#CC# / help
4y ago