Interviews3 answers
What are the differences between Class and Struts?
3 Answers
class is reference type
while struct is value type
Mukesh KumarPosted Sep 3, 2017, 12:52 AM EDT
http://www.c-sharpcorner.com/blogs/difference-between-class-and-struts1
Munesh SharmaPosted May 30, 2016, 9:18 PM EDT
Class
Class is a reference type
Class supports inheritance
Class variables are stored on Heap
Class can have destructor
Boxing a class object creates reference to same object
All the members of Class are private by default
Class is well suited for Data hiding
Struct
Struct is a value type
Struct will not support inheritance
Struct variables are stored on Stack
Struct will not have destructor
Boxing a strut object will create a copy in diff type
All the members of struct are public by default
Struts are not suited for Data hiding
Ajeet MishraPosted Sep 6, 2015, 10:12 PM EDT


