Why should virtual methods be explicitly overridden in C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By declaring a method as
virtual, you are stating your intention that the method can be overridden in a derived class.By declaring your implementing method as
override, your are stating your intention that you are overriding avirtualmethod.By requiring that the
overridekeyword be used to override a virtual method, the designers of the language encourage clarity, by requiring you to state your intentions.