I got an doubt why dot net framework have an abstract class, beacuse in normal base class we do everything,that we do with abstract class
Then why we need to use seperate abstract class,i knew the difference between these two,my question what special chracteristic its have on abtract class unlike base class features......
Dont provide any link to understand about abstract class..My question is we have accomblish everything using normal class then why we have abstract class...Please make it clear with serene points...
The simplest point is you can't ever create an abstract class directly. Example: you have an abstract class called Food, which is a base class for Fruit, which is a base class for classes Apples and Oranges. With this case, the classes Fruit, Apple, and
Oranges can be instantiated but not Food. This is very useful if you want to provide a base class that is only meant to offer base functionality, but is too generic to be called directory.
A really good example of this within the .net framework is the DbDataReader class (http://msdn.microsoft.com/en-us/library/system.data.common.dbdatareader.aspx). It's
abstract, but only provides base functionality for the datareaders that will actually make the calls. You can use the SqlDataReader, or OdbcDataReader to talk to their respective databases, but DbDataReader isn't useful as an object since it doesn't implement
any features for communicating with the specific architectures. Thus, it is a great base class, but has zero use as an object on it's own.
Don't forget to mark useful responses as Answer if they helped you towards a solution.
vijay_myl
Contributor
5070 Points
1068 Posts
why we need to use abstract class
Feb 25, 2013 04:19 AM|LINK
hi..
I got an doubt why dot net framework have an abstract class, beacuse in normal base class we do everything,that we do with abstract class
Then why we need to use seperate abstract class,i knew the difference between these two,my question what special chracteristic its have on abtract class unlike base class features......
My .NET blog
Submit Article
dhol.gaurav
Contributor
3998 Points
725 Posts
Re: why we need to use abstract class
Feb 25, 2013 04:23 AM|LINK
Check following links it may help you toa resolve your query
http://msdn.microsoft.com/en-us/library/sf985hc5%28v=vs.71%29.aspx
http://www.techotopia.com/index.php/Understanding_C_Sharp_Abstract_Classes
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
vijay_myl
Contributor
5070 Points
1068 Posts
Re: why we need to use abstract class
Feb 25, 2013 04:27 AM|LINK
Dont provide any link to understand about abstract class..My question is we have accomblish everything using normal class then why we have abstract class...Please make it clear with serene points...
My .NET blog
Submit Article
prabu.raveen...
Contributor
5020 Points
955 Posts
Re: why we need to use abstract class
Feb 25, 2013 04:28 AM|LINK
Below links may answer your query,
http://www.dotnetspider.com/forum/161460-What-an-abstract-class-Why-do-we-use-it.aspx
http://www.c-sharpcorner.com/interviews/answer/2269/
catherine se...
Member
692 Points
185 Posts
Re: why we need to use abstract class
Feb 25, 2013 04:33 AM|LINK
you can learn more about "Interface
design patterns "
the book <<Design Patterns: Elements of Reusable Object-Oriented Software>> may help you.
I think using interface is better than abstract class
if possible
Love Version Control and .NET Scanner SDK
vijay_myl
Contributor
5070 Points
1068 Posts
Re: why we need to use abstract class
Feb 25, 2013 04:42 AM|LINK
Hi catherine ..
I need the point where abstract class is have some sepecial cababilty when compare with normal class
My .NET blog
Submit Article
markfitzme
Star
14411 Points
2226 Posts
Re: why we need to use abstract class
Feb 25, 2013 04:54 AM|LINK
The simplest point is you can't ever create an abstract class directly. Example: you have an abstract class called Food, which is a base class for Fruit, which is a base class for classes Apples and Oranges. With this case, the classes Fruit, Apple, and Oranges can be instantiated but not Food. This is very useful if you want to provide a base class that is only meant to offer base functionality, but is too generic to be called directory.
A really good example of this within the .net framework is the DbDataReader class (http://msdn.microsoft.com/en-us/library/system.data.common.dbdatareader.aspx). It's abstract, but only provides base functionality for the datareaders that will actually make the calls. You can use the SqlDataReader, or OdbcDataReader to talk to their respective databases, but DbDataReader isn't useful as an object since it doesn't implement any features for communicating with the specific architectures. Thus, it is a great base class, but has zero use as an object on it's own.
vijay_myl
Contributor
5070 Points
1068 Posts
Re: why we need to use abstract class
Feb 26, 2013 01:50 PM|LINK
Hi..
Is there any reply or points..
My .NET blog
Submit Article