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
Why generics are used?
how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.
What is method and function in c#?
What is the use of the dispose method in C# ?
What is the difference between a constant and a static readonly field?
Why do we need to override in c#?
What is yield keyword?
How do I automate my desktop application?
What is asp net in c#?
What are logical operators in c#?
What is the difference between var and dynamic types in c# 4.0?
What are the advantages of generics in c#?
Can you explain template pattern?
Difference between debug.write and trace.write?
What operators can be used to cast from one reference type to another without the risk of throwing an exception?