public class Test
public Shared Sub Main
Dim cperson1 As New CPerson
Dim cperson2 As CPerson
cperson1.FirstName = "Alice"
cperson2 = cperson1
cperson2.FirstName = "Ben"
Console.WriteLine(cperson1.FirstName & ", " & cperson2.FirstName)
Dim sperson1 As New SPerson
Dim sperson2 As SPerson
sperson1.FirstName = "Alice"
sperson2 = sperson1
sperson2.FirstName = "Ben"
Console.WriteLine(sperson1.FirstName & ", " & sperson2.FirstName)
End Sub
End class
Public Class CPerson
Public FirstName As String
Public LastName As String
End Class
Public Structure SPerson
Public FirstName As String
Public LastName As String
End Structure
Ben, Ben
Alice, Ben