OOPS Archives - Coding Sharp

OOPS

Understand the value type and reference type

Understand the value type and reference type

Asp.Net, C#.Net, Difference, OOPS
In previous article we have seen difference between primary key and unique key. Today we will see the difference between value type and reference type. Let first see what are the value types and what are the reference types. What are Value Types? Variables which stores direct data are called value types they are stored on a stack. They contains the actual value rather then reference. For an example enum, structure int are value types. What are Reference Types? Variables which stores reference of actual data are called Reference types. They are stored on heap but contain the address on heap. For an example Array, class, object, string, delegate, interface are reference type. Now lets see the difference between both of them. Before that let me show you the difference betwe...