fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. class A {}
  6. class B : A {}
  7. class C : A {}
  8.  
  9. public static void Main()
  10. {
  11. A a1b = new B(), a2c = new C(), a3b = new B();
  12. Console.WriteLine(a1b.GetType() == a2c.GetType());
  13. Console.WriteLine(a1b.GetType() == a3b.GetType());
  14. }
  15. }
Success #stdin #stdout 0.01s 131136KB
stdin
Standard input is empty
stdout
False
True