Advertisement
Danielos168

Untitled

Apr 7th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. namespace ConsoleApp3
  2. {
  3.     class A { }
  4.     class B : A { }
  5.     class C : B { }
  6.     class D : E { }
  7.     class E : J { }
  8.     class I { }
  9.     class J : I{ }
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             B b = new B();
  15.             A a = new A(), c = new C();
  16.             I i = new I(), k = new D();
  17.             J j = new E(), d = new D();
  18.             Console.WriteLine(c is B); // t
  19.             Console.WriteLine(i is J); // f
  20.             Console.WriteLine(b is A); // t
  21.             Console.WriteLine(d is A); // f
  22.             Console.WriteLine(d is E); // t
  23.             Console.WriteLine(k is E); // t
  24.             Console.WriteLine(c is I); // f
  25.             Console.ReadKey();
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement