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
Explain repository pattern in asp.net mvc? : asp.net mvc
Where is asp.net view state stored?
Briefly describe the role of global.asax?
How to Insert/Add in ASPXgridview
Why session management is required?
When using the Pager object, inorder to know which page to go, which property you have to set to grid?
Is session stored in browser?
How can you apply a theme to your asp.net application?
Why web api is better than wcf?
What is ispostback property?
What are the ways of preserving data on a Web Form in ASP.NET?
What are the authentication types in asp.net?
Is a dll file an executable?
What is the purpose of App_Code folder in ASP.NET? Why we this?
Is asp.net and .net are same or different?