26.02.2015 Views

C#.Net Migration - A2Z Dotnet

C#.Net Migration - A2Z Dotnet

C#.Net Migration - A2Z Dotnet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>C#</strong> method dispatching modifiers<br />

From the perspective of a base class designer<br />

<strong>C#</strong> Syntax<br />

virtual<br />

abstract<br />

sealed<br />

Meaning<br />

Method may be replaced by derived class.<br />

Method must be replaced by a derived class (or redeclared abstract).<br />

Method may not be replaced by a derived class.<br />

From the perspective of a derived class designer<br />

<strong>C#</strong> Syntax<br />

Meaning<br />

override<br />

new<br />

Method replaces a virtual/abstract/override method in the base with its own<br />

implementation, and is still overridable by further derived types.<br />

Method is unrelated to a similarly defined method in the base class. Typically<br />

used to deal with a change to a base class that creates a collision where one<br />

didn't exist before, and where it's not practical to just choose a different method<br />

name.<br />

36

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!