Created
July 6, 2013 19:15
-
-
Save Fhernd/5940919 to your computer and use it in GitHub Desktop.
Prueba de la literal null.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NullPrueba | |
{ | |
static void Main() | |
{ | |
Punto punto = null; | |
Console.WriteLine(punto == null); // True | |
// Al intentar acceder a un dato miembro del objeto null | |
// en tiempo de ejecución se generará un error | |
// (una excepción NullReferenceException se lanza) | |
Console.WriteLine(punto.X); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment