what are the differences b/w structure and class?
Answer Posted / srikanth chodavarapu
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. class can have constructor, but structure cant have
constructor.
3. class can have garbage collector, but structure cant
have garbage collector.
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is default constructor in c#?
Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?
Is array a list?
How long can a string be c#?
What is integer c#?
How do you escape c#?
Can mvc be used for desktop applications?
If you define a user defined data type by using the struct keyword, is it a value type or reference type?
Which is faster iqueryable or ienumerable?
Explain how to use an extender provider in the project.
Is hashset ordered c#?
What is difference between association, aggregation and inheritance relationships?
What is the difference between abstract class and interface in c#?
What is tuple in c#?
Explain code compilation in c#.