Quantcast
Channel: DotNetRobert.com
Viewing all articles
Browse latest Browse all 10

Understanding and Creating Classes in C#

$
0
0

Find out how classes are defined and new instances are created, how to define Properties, and how to both set values and get values for a given instance of the class. A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behavior of a type. If the class is not declared as static, client code can use it by creating objects or instances which are assigned to a variable. The variable remains in memory until all references to it go out of scope. At that time, the CLR marks it as eligible for garbage collection. If the class is declared as static, then only one copy exists in memory and client code can only access it through the class itself, not an instance variable

Tip: Unlike structs, classes support inheritance

Here is a video on Understanding and Creating Classes in C#


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images