forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkey_2.vb
More file actions
18 lines (16 loc) · 1.02 KB
/
Copy pathkey_2.vb
File metadata and controls
18 lines (16 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Dim flight2 = New With {Key .Airline = "Blue Yonder Airlines",
Key .FlightNo = 3554, .Gate = "D14"}
' The following statement displays True. The values of the non-key
' property, Gate, do not have to be equal.
Console.WriteLine(flight1.Equals(flight2))
Dim flight3 = New With {Key .Airline = "Blue Yonder Airlines",
Key .FlightNo = 431, .Gate = "C33"}
' The following statement displays False, because flight3 has a
' different value for key property FlightNo.
Console.WriteLine(flight1.Equals(flight3))
Dim flight4 = New With {Key .Airline = "Blue Yonder Airlines",
.FlightNo = 3554, .Gate = "C33"}
' The following statement displays False. Instance flight4 is not the
' same type as flight1 because they have different key properties.
' FlightNo is a key property of flight1 but not of flight4.
Console.WriteLine(flight1.Equals(flight4))