---
title: "What are the differences between the class and structure?"  
description: "What are the differences between the class and structure?"  
author: "Ravi Vishwakarma"  
published: 2021-08-23  
updated: 2021-08-23  
canonical: https://www.mindstick.com/forum/156697/what-are-the-differences-between-the-class-and-structure  
category: "c#"  
tags: ["c#", "java", "c++"]  
reading_time: 1 minute  

---

# What are the differences between the class and structure?

What are the [differences](https://www.mindstick.com/articles/12918/cat-5e-vs-cat-6a-understanding-the-major-differences) between the [class and structure](https://www.mindstick.com/interview/23015/c-sharp-difference-between-class-and-structure)?

## Replies

### Reply by Ashutosh Kumar Verma

**Different between [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) and interface-**

| **Class** | **[Structure](https://www.mindstick.com/articles/23258/choose-your-business-structure-wisely)** |
| --- | --- |
| 1- Class is reference type. | Structure is value types. |
| 2- Instance is not created without 'new' keyword of class | Objects are created with and without 'new' keyword of structure. |
| 3- A class is declared by using 'class' keyword | A structure is created by using 'struct' keyword |
| 4- Values can assign of all types variables in a class. | In structure value are not assigned to the variables instead of 'const' and 'static' variable. |
| 5- Class access the reference of variables value. It does not store the value directly in memory | It directly access the value from variables and also store direct value of variables in memory. |
| 6- It is slower than structure. | It is faster than a class. |
| ``` ex- class Demo{private int a=10; public string name='Ashu';int age;} ``` | ``` ex- struct Demo{private const string name='Ashu';public string location;} ``` |

## \


---

Original Source: https://www.mindstick.com/forum/156697/what-are-the-differences-between-the-class-and-structure

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
