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

Why ref is used in c#?

550


Name the connections does microsoft sql server support?

559


Can you have parameters for static constructors?

606


What is the default value of boolean variable?

538


What is xamarin used for?

595






What is difference between events and delegates?

575


What are reflections in c#?

583


Can bool be null c#?

584


what is the difference between .dll and .exe

619


Why var is used in c#?

605


Can you access a hidden base class method in the derived class?

593


what is collections in .net? why we use?

1781


What is tryparse?

624


What is concatenation and when should it be used?

579


Is unboxing an implicit conversion?

628