Am I correct in believing that any object that doesn't inherit from System.ValueType must therefore by definition be a reference type?
I've been unable to find any conclusive documentation to backup this notion.
Objects are an example of a reference type. In the above example, both variables a and b will point to the same student object in memory. If we change a , we will also change b . This is because a and b are not storing the data but a reference to the location where the data is stored.
Yes, all struct s inherit from System. ValueType which in turn inherits from System. Object .
While value types are stored generally in the stack, reference types are stored in the managed heap. A value type derives from System. ValueType and contains the data inside its own memory allocation. In other words, variables or objects or value types have their own copy of the data.
Check if this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With