forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnothing_3.vb
More file actions
34 lines (27 loc) · 736 Bytes
/
Copy pathnothing_3.vb
File metadata and controls
34 lines (27 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Module Module1
Sub Main()
Dim testObject As Object
testObject = Nothing
Console.WriteLine(testObject Is Nothing)
' Output: True
Dim tc As New TestClass
tc = Nothing
Console.WriteLine(tc IsNot Nothing)
' Output: False
' Declare a nullable value type.
Dim n? As Integer
Console.WriteLine(n Is Nothing)
' Output: True
n = 4
Console.WriteLine(n Is Nothing)
' Output: False
n = Nothing
Console.WriteLine(n IsNot Nothing)
' Output: False
Console.ReadKey()
End Sub
Class TestClass
Public Field1 As Integer
Private field2 As Boolean
End Class
End Module