Classification of variables of C# programs

Mention the two categories which distinctly classifies the variables of the C# programs.

E

Expert

Verified

Variables which are defined in the C# program belongs to two major categories:

a) Reference type and

b) Value type.

Variables which are based on the value type contain a value which is either allocated on the stack or allocated in-line in the structure. Variables which are based on the reference types store the memory address of the variable, that in turn stores the value and are stored over the heap. The variables which are based on the value types have their own copy of data and thus, the operations done on one variable do not affects the other one.The reference-type variables reflect the changes which are made in the referring variables.

   Related Questions in DOT NET Programming

©TutorsGlobe All rights reserved 2022-2023.