Tag: 什么都没有

C#vs VB.NET – 处理null结构

我碰到了这个,并想知道是否有人可以解释为什么这在VB.NET中工作时我会期望它会失败,就像在C#中一样 //The C# Version struct Person { public string name; } … Person someone = null; //Nope! Can’t do that!! Person? someoneElse = null; //No problem, just like expected 但是在VB.NET中…… Structure Person Public name As String End Structure … Dim someone As Person = Nothing ‘Wha? this is okay? 没有什么不同于null( Nothing!= null – LOL?) ,或者这只是处理两种语言之间相同情况的不同方式? […]