A normal
class can be instantiated at runtime to form an Object with fields (fields are properties, functions, events, etc). A normal
class can also be inherited/sub-classed.
Adding one of the extra keywords change the way the class works.
- Adding
public, private, protected
changes the way other code can see and use this class.
- Adding
static
to a class means you can't create an instance with the new keyword but you can only access it through static function. Example: String.IsNullOrEmpty()
.
- Adding
sealed
to a class means no other class can inherit the 'sealed' class.
Interfaces are contracts
that say an implementing class will supply some functionality. The IDisposable
interface says that all classes implementing it will have a Dispose function.