Answer Posted / kiran
Following are the key differences between them :-
1. Structure are value types and classes are reference
types.So structures use
stack and classes use heap.
2. Structures members can not be declared as protected ,
but class members can
be.You can not do inheritance in structures.
3. Structures do not require constructors while classes
require.
4. Objects created from classes are terminated using
Garbage collector.Structures are not destroyed using GC.
Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
What is .dbml file?
What is the difference between xml documentation tag?
How to use the sreamReader class to read form a text file?
What are delegates in C#?
What is default value of enum c#?
What is dynamic dispatch?
What is the difference between int and int in c#?
What is the difference between ref & out parameters in c#?
What are delegates and why are they required?
Is string primitive?
What are controls in c#?
What is an example of delegation?
What is the difference between dynamic and var in c#?
Explain the process of polymorphism with an example?
What are the steps to create a webservice and consume it?