what are the differences b/w structure and class?
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
How to properly clean up excel interop objects?
Can struct inherit from class c#?
What is a collection in c#?
What is inheritance in csharp?
Describe how a .net application is compiled and executed
What does ienumerable mean?
What language do desktop applications use?
Is type nullable c#?
Why array is faster than arraylist in c#?
How long does it take to learn c# programming?
Explain About disco and uddi
Define a strong name in .net?
Can we override static class in c#?
Explain the Usage of web.config
How can I develop an application that automatically updates itself from the web?