output As String = testMethod().ToString() ' Works fine and output ="" int objectIntValue = classObject.testMethod(); // objectIntValue = 0
这里没有任何内容将转换为in
当使用 if 运算符()为一个对象赋值时,如果结果为空(null),则将0赋值给该对象。'Expected value is null (Nothing).Actual value assigned is 0.Dim x As System.Nullable(Of Integer) = If(1 = 0, 1, Nothing)
如果x是可空类型,为什么要为它指定默认的整数类型0</em