Structs are Value type variables and are stored on the stack, while Class are Reference type variables and are stored on the heap.
Struct do not support inheritance, while class supports inheritance. However struct can implements interface.
Struct should be used when you want to use a small data structure, while Class is better choice for complex data structure.
Asked In: Many Interviews |