Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

When should we use abtract class and Interface Class?Give
an Example

Answer Posted / pallavi

Use an abstract class when you want to inherit only from the parent
Use an interface when you want to inherit from multiple sources
If the behaviour of base class is default behaviour of all the sub classes the use abstract. If it is not default behaviour for all the classes use interface.
Interface - CAN-DO relationship
abstract class - IS-A relationship

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain repository pattern in asp.net mvc? : asp.net mvc

977


Where is asp.net view state stored?

950


Briefly describe the role of global.asax?

929


How to Insert/Add in ASPXgridview

975


Why session management is required?

951


When using the Pager object, inorder to know which page to go, which property you have to set to grid?

943


Is session stored in browser?

908


How can you apply a theme to your asp.net application?

910


Why web api is better than wcf?

1045


What is ispostback property?

861


What are the ways of preserving data on a Web Form in ASP.NET?

1028


What are the authentication types in asp.net?

1007


Is a dll file an executable?

977


What is the purpose of App_Code folder in ASP.NET? Why we this?

1190


Is asp.net and .net are same or different?

936