I'm wondering if anyone can answer these pretty basic OOP questions dealing with classes and memory addresses..
Public Class TestClass
Public s As String
End Class
Dim X As New TestClass
X.s = "Test 1"
Dim Y As TestClass = X
Dim Z As TestClass = X
Am I correct in saying X holds the original copy of TestClass and Y and Z are just Pointers that point to the copy of X?
So if I...
Y.s = "Test 2"
That changes the original "s" in element X right so now (X,Y,Z).s all equal "Test 2"
Now if I do a
X = Nothing
Y.s and Z.s still show the "Test 2" but now where has the Original copy that was in X gone? Are Y and Z still just pointers or does one of them now contain the original ? Im wondering because if X is no longer a object, Y and Z shouldn't be able to access it anymore right??
I'm confused.. :p
