Working with Abstract classes, Sealed Classes, and Interfaces in C#
page 7 of 7
by SANJIT SIL
Feedback
Average Rating: 
Views (Total / Last 10 Days): 48452/ 56

Conclusion

Well, this is my thought on interfaces and abstract classes, we want to have an abstract class when concrete classes will be sharing similar implementation details, like each employee has a name, that field can be stored in the abstract class, and also the property to access that information can be in the abstract class.  So when we have similar classes that will share code use an abstract class, however if we have classes that are nothing to do with one another but share some aspect that they do not share a common ancestor then use an interface.  Use sealed classes when the class should not have any derived classes.


View Entire Article

User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-19 10:01:53 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search