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

Can you explain the basic use of dataview?

811


Which data type does the rangevalidator control support?

710


Can you explain one critical mapping? Performance issue which one is better? Whether connected lookup tranformation or unconnected one?

1009


How can i explain my project during interview?many time i expalain my project but they did't accept? please explain me.

5288


Is asp.net mvc still used? : Asp.Net MVC

687


COM+ Used ________________ Isolation Level

1707


What are themes and skins in 2.0, explain usage scenario?

703


Explain how dot net compiled code will become platform independent?

717


What is asp.net response object?

770


What is the usage of DelegatingHandler?

778


How does windows service lifecycle differ from a .standard. Exe?

712


What is difference between Fragment Caching and Page Caching in ASP.NET?

785


What is custom events? How to create it?

807


What is the difference between client-side and server-side validations in ASP.NET?

867


What is data cache in sql server?

801