---
title: "Difference between Class and struct"  
description: "Difference between Class and struct"  
author: "Manish Kumar"  
published: 2017-03-08  
updated: 2020-09-14  
canonical: https://www.mindstick.com/interview/23230/difference-between-class-and-struct  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Difference between Class and struct

## struct-

- struct is a value type
- It is faster than class
- It cannot declare default constructor or destructor however it can have parameterized constructor
- It cannot derive another struct.
- struct have all members public by default.

## Class-

- Class is reference type.
- It is like blueprint of logical data.
- It is slower than struct.
- It can declare default constructor.
- Class has all member private by default.

## Answers

### Answer by Manish Kumar

## struct-

- struct is a value type
- It is faster than class
- It cannot declare default constructor or destructor however it can have parameterized constructor
- It cannot derive another struct.
- struct have all members public by default.

## Class-

- Class is reference type.
- It is like blueprint of logical data.
- It is slower than struct.
- It can declare default constructor.
- Class has all member private by default.


---

Original Source: https://www.mindstick.com/interview/23230/difference-between-class-and-struct

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
