In C#, types are divided into two main categories: value types and reference types.
Value TypesThe variables of the value types directly contain their value. Listing given below shows an example of value type int(10), struct (Book), and enum (Planets). Listing 1-5 shows how we can determine the usage of the value type in a program.
Example of Value Types
Figure 1-7 demonstrates the possible different value types.
Reference TypesIn C#, the reference type is either the class type, an interface type, an array type, or a delegate type.
Listing given below shows the usage of these reference types.
Example of the Reference Types
Figure 1-8 shows the possible different reference types.