What are the differences between value and reference types



Sno


Value Types



Reference Types

1

They contain their data directly

They store a reference to their value’s memory

2

They are allocated for storage either in stack or inline in structure..

They are allocated for storage in heap

3

can be built-in (implemented by the runtime), user-defined, or enumerations

self-describing types, pointer types, or interface types.

0 comments:

Post a Comment