Advertisement
Fhernd

UsoComprobacionGetType.cs

Jul 28th, 2014
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Recetas.Cap03
  4. {
  5.     internal class UsoComprobacionGetType
  6.     {
  7.         public static void Main()
  8.         {
  9.             int num1 = 13;
  10.             int num2 = 83;
  11.             long num3 = 19;
  12.            
  13.             Console.WriteLine ("¿`num1` y `num2` son del mismo tipo?: {0}",
  14.                        Object.ReferenceEquals(num1.GetType(),num2.GetType()));
  15.                        
  16.             Console.WriteLine ("¿`num1` y `num3` son del mismo tipo?: {0}",
  17.                        Object.ReferenceEquals(num1.GetType(),num3.GetType()));
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement