abstract method in non abstract class
-
Hi, I have a question regarding abstract methods if i place an abstract method in non abstract class what will happen if i doesnt implement that method in derived class Any updates would be appreciated Thanks
Thanks Mukkanti
-
Hi, I have a question regarding abstract methods if i place an abstract method in non abstract class what will happen if i doesnt implement that method in derived class Any updates would be appreciated Thanks
Thanks Mukkanti
mukkanti007 wrote:
if i place an abstract method in non abstract class
You can't. It breaks the semantics of being abstract.
Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Mixins in C#3.0 My website | Blog
-
Hi, I have a question regarding abstract methods if i place an abstract method in non abstract class what will happen if i doesnt implement that method in derived class Any updates would be appreciated Thanks
Thanks Mukkanti
If the class contains an abstract member, then the class must be marked abstract.
-
Hi, I have a question regarding abstract methods if i place an abstract method in non abstract class what will happen if i doesnt implement that method in derived class Any updates would be appreciated Thanks
Thanks Mukkanti
mukkanti007 wrote:
if i place an abstract method in non abstract class
Not possible. If you want a method that is optional to override, you should make it virtual. The base class has to have an implementation of the method, but you can just throw an NotImplementedException exception in the method.
Despite everything, the person most likely to be fooling you next is yourself.