Class | Struct |
1. In Class, data type is reference type and it stored on the heap. | 1. In Struct, data type is value type and it stored on the stack. |
2. It supports inheritance | 2. It doesn't support inheritance. |
3. Default values of a class type is null. | 3. Default values is the value produced by 'zeroing out' the fields of the struct. |
4. It permits initialization of instance fields. | 4. It doesn't permit initialization of instance fields. |
5. It supports destructor. | 5. It doesn't supports destructor. |
6. It permit declaration of parameter-less constructors | 6. It doesn't permit declaration of parameter-less constructors |
7. Assignment copies the reference. | 7. Assignment copies the values. |