What is difference between value and reference types ?

Answer Posted / gowthami

value types are stored in the memory.
reference types are stored in the heap.
all implicit datatypes,enums,structs are value types.
delegates,objects are reference types..
pointer to the heap where the data is located is maintained
in the stack
when we delete a reference type pointer to the heap is
deleted from the stack

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do generics work in c#?

669


What Is An Interface Class?

771


What do you mean by “finalize” and “finally” methods in c#?

691


How Global.asax is used ?

817


When do we generally use destructors to release resources?

699


What is thread in c#?

738


What is serialization and deserialization in c# with example?

657


Explain deadlock?

673


What is web forms in c#?

683


How do I create a multilanguage, single-file assembly?

700


What standard types does c# use?

700


Explain how do I get deterministic finalization in c#?

684


What is the difference between structure and class in c#?

678


What is the difference between firstordefault and singleordefault?

673


What is object array in c#?

721