expressionliteralnothinga.vb

来自「大名鼎鼎的mono是.NET平台的跨平台(支持linux」· VB 代码 · 共 30 行

VB
30
字号
'Author: Ritvik Mayank <mritvik@novell.com>'Copyright (C) 2005 Novell, Inc (http://www.novell.com)'Nothing keyword represents the default value of any data typeOption Strict OffImports SystemImports Microsoft.VisualBasicModule ExpressionLiteralsChar    Function Main() As Integer        Dim L As Long, S As String, B As Boolean, O As Object, D As Date        B = Nothing        If B <> False Then            Throw New Exception("Unexpected Behavior of Nothing. As B should be assigned Flase")        End If        S = Nothing        If S <> Nothing Then            Throw New Exception("Unexpected Behavior of Nothing. As S should be assigned Nothing")        End If        D = Nothing        If D <> #12:00:00 AM# Then            System.Console.WriteLine("Unexpected Behavior of Nothing. D not set to default value") : Return 1        End If        L = Nothing        If L <> 0 Then            Throw New Exception("Unexpected Behavior of Nothing. As L should be assigned 0 ")        End If    End FunctionEnd Module

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?