Category: Class Members

Class Members

Partial Methods C#

Partial Methods C#

A partial method has its signature defined in one part of a partial type, and its implementation defined in another part of the type. Partial methods enable class designers to provide method hooks, similar...

Partial Class C#

Partial Class C#

It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all...

Virtual keyword C#

Virtual keyword C#

The virtual keyword is used to modify a method, property, indexer or event declaration, and allow it to be overridden in a derived class. For example, this method can be overridden by any class...

Defining Properties

Defining Properties

Properties are defined in a similar way to fields, but there ’ s more to them. Properties, as already discussed, are more involved than fields in that they can perform additional processing before modifying...

Defining Methods

Defining Methods

Methods use standard function format, along with accessibility and optional static modifiers Example Remember that if you use the static keyword, then this method is accessible only through the class, not the object instance....

Access Specifiers in C#

Access Specifiers in C#

Within a class definition, you provide definitions for all members of the class, including fields, methods, and properties. All members have their own accessibility levels, defined in all cases by one of the following...