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
How can you force derived classes to provide new method implementations for virtual methods?
Structs are not reference types. Can structs have constructors?
What is inner class in c#?
Is javascript harder than c#?
List down the access modifiers available in c#?
You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?
Why is ienumerable used?
Can a abstract class have a constructor?
How to parse a date time string?
What are the 2 broad classifications of data types available in c#?
How many types of delegates are there in c#?
What is class method?
What do you mean by saying a "class is a reference type"?
What is a multicast delegate in c#?
Define a strong name in .net?