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


Please Help Members By Posting Answers For Below Questions

What is Event - Delegate?

575


What does .length do in c#?

526


What is an int c#?

482


Is c# scripting language?

507


How many aware interfaces are there?

490






What is constructor overloading in c#?

500


What is difference between virtual and override in c#?

462


What is a long in c#?

458


What is difference between string and stringbuilder in c#?

466


Why do we need collections in c#?

471


What does question mark mean in c#?

569


What is view model in c#?

467


Can we inherit class that contains only one private constructor?

524


Name some string escape sequences in c#.

572


Who is a accessibility modifier “protected internal” available to ?

602