Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //The C# Version
- struct Person {
- public string name;
- }
- ...
- Person someone = null; //Nope! Can't do that!!
- Person? someoneElse = null; //No problem, just like expected
- Structure Person
- Public name As String
- End Structure
- ...
- Dim someone As Person = Nothing 'Wha? this is okay?
- 'This is false - It is still a person'
- Dim someone As Person = Nothing
- Dim isSomeoneNull As Boolean = someone.Equals(Nothing) 'false'
- 'This is true - the result is actually nullable now'
- Dim someoneElse As Nullable(Of Person) = Nothing
- Dim isSomeoneElseNull As Boolean = someoneElse.Equals(Nothing) 'true'
Add Comment
Please, Sign In to add comment