Dim a As Decimal = Decimal.Parse("1.10") Dim b As Decimal = Decimal.Parse("1.1000") Console.WriteLine("A={0}", a) 'A=1.10 Console.WriteLine("B={0}", b) 'B=1.1000 Console.WriteLine("ReferenceEquals : {0}", ReferenceEquals(a, b)) 'ReferenceEquals : False Console.WriteLine("Equals : {0}", Equals(a, b)) 'Equals : True Console.WriteLine("= : {0}", a = b) '= : True
Dim a As IPAddress = IPAddress.Parse("143.24.20.36") Dim b As New IPAddress(New Byte() {143, 24, 20, 36}) Console.WriteLine("ReferenceEquals : {0}", ReferenceEquals(a, b)) 'ReferenceEquals : False Console.WriteLine("Is 演算子 : {0}", a Is b) 'Is 演算子 : False Console.WriteLine("Equals : {0}", Equals(a, b)) 'Equals : True