Difference between Class and Structure :

Oct 18, 2011
Class Structure
Class is group of common objects that share common properties and relationships. Structure is a collection of different types of data type.
Class members are private by default. Structure members are public by default.
Classes are reference type i.e. they are stored on heap Structure are value type i.e. they are stored on stack
Class can be inherited. Structure can not be inherited.
Class is better choice for complex data structure Structure should be used when you want to use a small data structure
Class elements can be declared as protected Structure elements can not be declared as protected
Classes are terminated i.e. GC does call finalize method for them Structure are not terminated i.e. GC does not call finalize method for them
Class does require constructor. Structure does not require constructor.