Below are the points to specify the difference between the class and Structure:
Structure is not referenced type, but it is a value type. where as class is a reference type Reference type means that memory is allocated only when the object is created.
Value type means memory is allocated when declaration is done means hold the values in the memory at the time of declaration.
Structure is declare by using Keyword as Struct.
The structure does not support Inheritance.
The structure does not have destructor.
The structure does not have a default constructor.
A structure can implement one or more than one interface.
Structure members cannot be specified as abstract, virtual, or protected.
Thanks
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Below are the points to specify the difference between the class and Structure:
Structure is not referenced type, but it is a value type. where as class is a reference type
Reference type means that memory is allocated only when the object is created.
Value type means memory is allocated when declaration is done means hold the values in the memory at the time of declaration.
Structure is declare by using Keyword as Struct.
The structure does not support Inheritance.
The structure does not have destructor.
The structure does not have a default constructor.
A structure can implement one or more than one interface.
Structure members cannot be specified as abstract, virtual, or protected.
Thanks