Getsuyodev, Programming is mainly used when constructing an application. Programming requires knowledge of application domains, algorithms, and programming language expertise. Programming can be developed in different logic based on developer knowledge.

C# Types

A Type is defined as a set of data and the operations performed on them. C-Sharp is a strongly typed language. The C-Sharp type system contains three Type categories. They are Value Types, Reference Types and Pointer Types. The Value Types store the data while the Reference Types store references to the actual data. Pointer Types variable used only in unsafe mode. The Value Types derived from System.ValueType and the Reference Types derived from System.Object.

The main difference between Value Types and Reference Types is that how these Types store the values in memory. Common Language Runtime (CLR) allocates memory in Stack and the Heap. A Value Type holds its actual value in memory allocated on the Stack, and Reference Types referred to as objects, store references to the real data. In C#, it is possible to convert a value of one type into a value of another type. The operation of Converting a Value Type to a Reference Type is called Boxing, and the reverse process is called Unboxing.

Comments are closed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More