Please explain value types and reference types used in c#?



Please explain value types and reference types used in c#?..

Answer / Raju Chaudhary

Value Types (also known as System.ValueType) are simple data types such as int, bool, and structs that store their values directly in the variable. When a value type is assigned to another variable, a copy of its value is created. Reference Types (also known as object) include classes, arrays, interfaces, delegates, and strings. They store a reference to the memory location where the actual data is stored. When a reference type is assigned to another variable, it copies the reference, not the actual data.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is a console device?

1 Answers  


Is array value type in c#?

1 Answers  


How many destructors can a class have?

1 Answers  


How do I declare a pure virtual function in c#?

1 Answers  


Is lazy thread safe c#?

1 Answers  


What is the correct way of declaring an xml namespace?

1 Answers  


Is c# and c sharp same?

1 Answers  


What is the default value of guid in c#?

1 Answers  


What is an ienumerable in c#?

1 Answers  


what is used ref keyword in c#,and how we used it?

2 Answers  


What is event delegate in c#?

1 Answers  


What is the concept of strong names?

1 Answers  


Categories