Difference between reference types and value types. : Pass by Value « Class Module « VB.Net Tutorial






Class Class1
    Public Value As Integer = 0
End Class

Class Test
    
    Shared Sub Main()
        Dim val1 As Integer = 0
        Dim val2 As Integer = val1
        val2 = 123
        Dim ref1 As New Class1()
        Dim ref2 As Class1 = ref1
        ref2.Value = 123
        Console.WriteLine("Values: {0}, {1}", val1, val2)
        Console.WriteLine("Refs: {0}, {1}", ref1.Value, ref2.Value)
    End Sub
End Class








6.5.Pass by Value
6.5.1.Pass Integer by value to a function
6.5.2.Pass Single by value and by reference to a function
6.5.3.Difference between reference types and value types.