There are two ways to allocate space in memory. One is value type and another is Reference type. When you create int, char or float, struct type variable, it creates value type memory allocation whereas when you create object of class, it creates reference type memory allocation.
- Value Type: A value type variable directly contains data in the memory.
- Reference Type: A Reference type variable contains memory address of value.
No comments:
Post a Comment