// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: GetTypeYtypeof.cs
//
// Propósito: Uso general del método GetType y el operador
// typeof
//
============================================================*/
using System;
public class Punto
{
public int X
{
get;
set;
}
public int Y
{
get;
set;
}
}
public class Prueba
{
public static void Main()
{
Punto p = new Punto();
Console.WriteLine( p.GetType().Name);
Console.WriteLine( typeof (Punto).Name);
Console.WriteLine( p.GetType() == typeof(Punto));
Console.WriteLine( p.X.GetType().Name);
Console.WriteLine( p.Y.GetType().Name);
}
}
Ly8gPT09Kys9PT0KLy8KLy8JT3J0aXpPTAovLwovLyA9PT0tLT09PQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQovLwovLyBDbGFzZTogR2V0VHlwZVl0eXBlb2YuY3MKLy8KLy8gUHJvcMOzc2l0bzogVXNvIGdlbmVyYWwgZGVsIG3DqXRvZG8gR2V0VHlwZSB5IGVsIG9wZXJhZG9yCi8vIHR5cGVvZgovLwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwoKdXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFB1bnRvCnsKCXB1YmxpYyBpbnQgWAoJewoJCWdldDsKCQlzZXQ7Cgl9CgkKCXB1YmxpYyBpbnQgWQoJewoJCWdldDsKCQlzZXQ7Cgl9Cn0KCnB1YmxpYyBjbGFzcyBQcnVlYmEKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCVB1bnRvIHAgPSBuZXcgUHVudG8oKTsKCQkKCQlDb25zb2xlLldyaXRlTGluZSggcC5HZXRUeXBlKCkuTmFtZSk7CgkJQ29uc29sZS5Xcml0ZUxpbmUoIHR5cGVvZiAoUHVudG8pLk5hbWUpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKCBwLkdldFR5cGUoKSA9PSB0eXBlb2YoUHVudG8pKTsKCQlDb25zb2xlLldyaXRlTGluZSggcC5YLkdldFR5cGUoKS5OYW1lKTsKCQlDb25zb2xlLldyaXRlTGluZSggcC5ZLkdldFR5cGUoKS5OYW1lKTsKCX0KfQ==