answersLogoWhite

0


Best Answer

In C#, a reference type [of object] is an object created from a class, a value type is an object created from a struct.

2 value type of objects are identical if their value/state are the same, while reference type are identical only if their storage address are the same.

In C#, unless you can look at the definition of an object, usually you don't know the object is a value type or reference type.

public struct MyThing {}

public class Toy {}

MyThing cat = new MyThing();

MyThing dog = new MyThing();

Console.WriteLine(cat yours); // False

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the reference type and value type?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is array list value type or reference type?

Arrays are reference type. array values are always pass by reference.


Is string a value type or a reference type?

It can depend on what language you are using, but it's generally a reference type.


Is array is value type or reference type in CSharp?

refernce type


Array is value type or reference type in CSharp?

Array is a class name, hence ought to be a value type.


What is the difference between value type parameters and reference type parameters?

When a variable is passed by value, the function receives a copy of the variable. When a variable is passed by reference, the function receives a reference, or pointer, to the original data.


What function key will change a cell reference formula value to an absolute value in Excel 2010?

The F4 key can be used as you are typing in the cell reference in order to change it to a different reference type.


How get value integer type in GUI box?

In C#, a reference type [of object] is an object created from a class, a value type is an object created from a struct. value type of objects are identical if their value/state are the same, while...


Array is value type or reference type in c?

An array always stores the values in its different shells. Whenever the shell position or number or address is mentioned it means the address of the required value is mentioned. then the value of the mentioned address is fetched. So, array is a reference type in c language.


How many values you can return by call by value and call by reference at a time?

A function can only return one value, but it can modify its parameters if their type is 'in out' or 'out'.


Where the Memory is allocated for a variable in a program?

if a variable is of value type memory is allocated on stack memory.. if it is of reference type,memory is allocated on heap memory..


What is meant by value type and reference type in?

When you work with passing by value C creates a copy of the variable which is referencing to. Thus, it spends free RAM space just to dublicate the variable which already excists.When you work with passing by reference type C works with address of the variable, what makes using of free RAM space more efficient.


Why pointers are passed by reference?

It is by-value, actually, not by-reference.