📝 What is the difference between a Struct and a Class in C#?



Class and struct both are the user defined data type but have some major difference:



Struct



🔸 The struct is value type in C# and it inherits from System.Value Type.



🔸 Struct is usually used for smaller amounts of data.



🔸 Struct can't be inherited to other type.



🔸 A structure can't be abstract.



Class



🔸 The class is reference type in C# and it inherits from the System.Object Type.



🔸 Classes are usually used for large amounts of data.



🔸 Classes can be inherited to other class.



🔸 A class can be abstract type.



🔸 We can create a default constructor.



#post