---
title: "What is the difference between reference type and value type?"  
description: "What is the difference between reference type and value type?"  
author: "Shikhar Arora"  
published: 2019-12-06  
canonical: https://answers.mindstick.com/qa/92522/what-is-the-difference-between-reference-type-and-value-type  
category: "database"  
tags: ["database programming", "database"]  
reading_time: 1 minute  

---

# What is the difference between reference type and value type? 

What is the [difference](https://yourviews.mindstick.com/story/5016/chia-vs-basil-seeds-what-s-the-difference) between [reference type and value](https://www.mindstick.com/interview/23229/difference-between-reference-type-and-value-type) type

## Answers

### Answer by Rahul Roi

## ![What is the difference between reference type and value type?](https://answers.mindstick.com/questionanswer/db90a51b-3269-4332-832f-3ce88a47db15/images/179c33cb-342e-4db2-aca8-f8e5ceedf263.jpeg) \

## The Value Type

The [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages)-type variables can be assigned a value directly. These are derived from the class System.ValueType. The value types directly contain data. If you declare an int type, the system allocates memory to store the value.

```
The Value Type variables are stored in the stack.
```

These are examples like :-

- Int
- char
- float

which stores numbers, alphabets, and floating point numbers, respectively. ![What is the difference between reference type and value type?](https://answers.mindstick.com/questionanswer/db90a51b-3269-4332-832f-3ce88a47db15/images/46c50447-4fac-4032-b606-3d3c690c2150.jpeg)\
[Reference Type](https://www.mindstick.com/interview/1820/what-are-value-types-and-reference-types) That refers to a memory location. The using multiple variables, the reference types can refer to a memory location. When the data in the memory location is changed by one of the variables, the other variable automatically reflects this change in value.

```
The Reference Type variables are stored in the heap.
```

Example of built-in reference types are −

- object
- dynamic
- string

Read More Technical content :- [MindStick Forum](https://www.mindstick.com/developersection/forum)


---

Original Source: https://answers.mindstick.com/qa/92522/what-is-the-difference-between-reference-type-and-value-type

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
