How can you force derived classes to provide new method implementations for virtual methods?
Answer / Gaurav Kumar Varshney
In C#, you can force a derived class to override a virtual method using the 'new' keyword. For example: public class BaseClass { public virtual void MyMethod() { ... } } public class DerivedClass : BaseClass { public new void MyMethod() { ... } }
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the purpose of dictionary in c#?
What's difference about switch statements in C# ?
What is the difference between CreateObject() and GetObject()?
What is a race condition?
what is difference between destruct or and garbage collection ?
What are the types of class in c#?
What is the difference between serialization and deserialization in c#?
If c# destructors are so different to c++ destructors, why did ms use the same syntax?
How to use the sreamReader class to read form a text file?
Is linkedhashset synchronized?
What?s the implicit name of the parameter that gets passed into the class? set method?
Can variables defined in interface. If yes how we can call/use it in class.
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)