Hi Friends....
Can we declare override method is static and original method is non static ? Please explain ?
Thanks.....
Static Override Method
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 2, 2012, 6:06 AM EST
No, you cannot, the signature of the virtual method must remain the same, only the keyword "virtual" is changed to keyword "override" .
//Base Class
Public Class BaseClass
{
public virtual string Name()
{
return "my name";
}
}
//Derived Class
Public Class DerivedClass
{
public override string Name()
{
return "my name is abcd";
}
}
Thanks
VulpesRank #55 · 29.2K reputationPosted Feb 2, 2012, 6:03 AM EST
Prabhu RajaRank #861 · 2.6K reputationPosted Feb 2, 2012, 8:33 AM EST
No, We can't do this, because Static Members can not be marked as a virtual, abstract or override.
Vineet Kumar SainiRank #257 · 9.8K reputationPosted Feb 2, 2012, 1:01 PM EST