C# Keyword Modifiers


InterServer Web Hosting and VPS

C# Keyword Modifiers

Here we'll look at some of the C# Keyword Modifiers, specifically the ones related to object oriented programming and inheritance.

C# Keyword Modifiers for Inheritance


  • abstract
  • override
  • new
  • sealed
  • virtual


abstract

The abstract modifier indicates that the thing being modified has a missing or incomplete implementation. On a class, abstract usually means that some of the methods need to be implemented by the inheriting class. Abstract classes are sort of a combination of a class and an interface, in that some methods may be implemented, and some are not. Any member marked as abstract will need to be implemented by the derived class (class, method, property, indexer, and event).

override

The override modifier is used to extend or modify an abstract or virtual member (method, property, indexer, event).

new

The new modifier hides a member which has been inherited from a base class, thus replacing the original member from the base class.

sealed

The sealed modifier is used to prevent classes from inheriting this member (class, method, property).

virtual

The virtual marks a member which is allowed to be overridden by a derived class (method, property, indexer, event)


Sponsored Links
SolarSystem - AngularJS Demo
SolarSystem - Angular JS Demo

Check out my first Angular JS demo hosted in Azure, it helped win my first Angular contract. Put the sound on.