What is value type and reference type?
Answers were Sorted based on User's Feedback
Answer / usman
In simple words value types are those datatypes that store
there values on stack memory and values are settle down at
compile time example are "ENUM" and reference type are
those datatype that store there values in heap memory and
settle down while run time i.e dynamic types examples are
strings,class type etc
Cheers
Is This Answer Correct ? | 10 Yes | 1 No |
Value types are the variables that directly contain the
vaiue and are stored in stack memry.
Example: int, char, float...
Reference types does not contain the value directly but has
the address of the value i.e reference address..
Reference types are stored in Heap memory.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / sushma
value types store values,even if we copy that the orginal
one it is uneffected,even if we modify the copied one ,
the reference types stores refereneces of the object, if
copy that one ,it is effected,if we modify the copied one
Is This Answer Correct ? | 0 Yes | 0 No |
Is c sharp free?
How many catch blocks can be there for a single try block?
Does c# support multiple class inheritance?
Is it possible to add two 50 digit numbers in .net? If yes what is the code snippet?
2 Answers Cognizant, W3 Solutions, Zefer,
Can you create partial delegates and enumerations?
What is default value of decimal c#?
What is the use of convert toint32 in c#?
why c# is pronounced as C-sharp instead of pronouncing it as C-hash? is there any technical reason behind it?
What is multicast delegate in c# ?
How to use reflection to call generic method?
What is c sharp language?
What is difference between sleep () and wait ()?