Question about classes in C #

Community Forums/General Help/Question about classes in C #

Yue(Posted 2014) [#1]
What is a sealed class? What is an Abstract class? and that is a class that is not declared or sealed or abstract.


Who was John Galt?(Posted 2014) [#2]
A class declared as sealed is one that cannot be inherited.
An abstract class is one that cannot be instantiated- objects cannot be created from it- so it is only used as a template from which other classes can inherit.


Yue(Posted 2014) [#3]
Thank you very much, an interface is a class?


ziggy(Posted 2014) [#4]
No, an interface is a set of declarations any class can implement. It's used to tell that any class that implements a given interface can perform a given task. As instance, any class that implements a iSortable interface, will be forced to have a "Compare" method, so any object of this class can be used on any sorting algorithm.
this allows a sort of multiple-inheritance approach, while it keeps a clean and nicer inheritance model.


Yue(Posted 2014) [#5]
Ok, Thanks You :)