Working with Abstract classes, Sealed Classes, and Interfaces in C#
page 7 of 7
Average Rating: 
Views (Total / Last 10 Days): 47801/ 87


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  |  Page Processed at 2024-05-22 6:55:08 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search