sainath reddy
what diff b\w abstract and interface? when will go for abstract& interface
Posted by sainath reddy in .Net | ASP.NET on Oct 25, 2010
0
Do you know the answer for this question? Post it below.
Guest

Abstract Class:

1. Abstract Class Can contain Abstract Methods and Non-
Abstract Methods.

2. When a Non-Abstract Class is Inherited from an Abstract
Class, the Non-Abstract Class should provide all the
implementations for the inherited Abstract Method.

Interface:

1. Interface is nothing but Pure Abstract Class ie
Interface can contain only the function declaration.

2. All the members of the interface are Public by Default
and you cannot provide any access modifiers.

3. When a class is inherited from the interface, the
inherited class should provide actual implementations for
the inherited members.

Posted by Harshit Vyas on Nov 11, 2010

Abstract and interface both are similar
but some difference

Posted by raj gupta on Oct 30, 2010

When there is a need to inheritance then abstract class should be used.
And When there is need to common functionality implementation by more then one class then Interfaces should be used.

Posted by prakash gajera on Oct 27, 2010

Abstract class contains pure virtual function and must/can be inherited by the derived class to implement inheritance.
Where as Interface contains only definition of the functions and must/can be implemented by any other class.

Posted by prakash gajera on Oct 27, 2010
Sponsored by
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Sponsored by
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.