13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11 Typesreference-type:class-typeinterface-typearray-typedelegate-typeclass-type:type-nameobjectstringinterface-type:type-namearray-type:non-array-type rank-specifiersnon-array-type:typerank-specifiers:rank-specifierrank-specifiers rank-specifierrank-specifier:[ dim-separators opt ]dim-separators:,dim-separators ,delegate-type:type-nameA reference type value is a reference to an instance of the type, the latter known as an object. The specialvalue null is compatible with all reference types and indicates the absence of an instance.11.2.1 Class typesA class type defines a data structure that contains data members (constants and fields), function members(methods, properties, events, indexers, operators, instance constructors, destructors, and static constructors),and nested types. Class types support inheritance, a mechanism whereby derived classes can extend andspecialize base classes. Instances of class types are created using object-creation-expressions (§14.5.10.1).Class types are described in §17.11.2.2 The object typeThe object class type is the ultimate base class of all other types. Every type in <strong>C#</strong> directly or indirectlyderives from the object class type.The keyword object is simply an alias for the predefined class System.Object.11.2.3 The string typeThe string type is a sealed class type that inherits directly from object. Instances of the string classrepresent Unicode character strings.Values of the string type can be written as string literals (§9.4.4).The keyword string is simply an alias for the predefined class System.String.95

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

Saved successfully!

Ooh no, something went wrong!