|
hi,I have query when i should use abstract class,what is the use of abstract class over normal class.since Can do same thing with the normal class as well so why i should go for abstrct class,why we create abstact method. eg abstract class ABC { void myfunc() { console.write("hello"); the same thing can be done with normal class as well also normal class can be instaintiated.so why we go for abstract class. class ABC { void myfunc() { console.write("hello"); same implemented i can do using normal class as well just make a virtual function and overvide it.also having a default function myfunction,also i can make object of it.so why i shall go for abstract class.what are the benefit of abstract class and abstract method. what is the use of this abstract method i can make a virtual function as well.
(comments are locked)
|
|
You would want to use abstract when you don't intend for the user to instantiate the class because it is too general and simply serves to define common members for sub-classes. Abstract members cannot contain default implementation code and must be overridden, virtual members may contain default implementation code.
(comments are locked)
|


It looks like you have struck lucky and got an answer to your question but this forum is generally focussed on SQL Server and Oracle problems. You may find more responses to your problems if you search for a bespoke C# forum.