In VB.net, when I retrieve a value from a list do I get a copy of that value or a reference to it?
dim blah as someObject
dim listOfBlahs as list(of someObject)
listOfBlah.add(new someObject(1))
blah = listOfBlah(0)
blah.setValue = 500
Does the value of listOfBlah(0) get updated to 500?
blah will point to the same memory location as listOfBlah(0). Setting a property on the object at that location will affect the object in memory at that location. If you set blah = someOtherObject later, then the object in the memory location for listOfBlah(0) will not be affected because effectively you’re pointing blah at a different object.
This is generally the case, but for a more in depth discussion, you should take a look at Microsoft’s documentation on value types and reference types: http://msdn.microsoft.com/en-us/library/aa711899(v=vs.71).aspx