Classes will be used to implement most objects. Sometimes, however, it may be desirable to create an object that behaves like one of the built-in types; one that is cheap and fast to allocate and doesn’t have the overhead of references. In that case, a value type is used, which is done by declaring a struct in C#.
KeywordsStruct Point Class Instance Reference Type String Type Reference Semantic
Unable to display preview. Download preview PDF.
- 1.Technically, structs are derived from System. ValueType, but that’s only an implementation detail. From a language perspective, they act as if they’re derived from System.Object.Google Scholar