fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Console.WriteLine(typeof(Base).IsAssignableFrom(typeof(Derived)));
  8. Console.WriteLine(typeof(Derived).IsAssignableFrom(typeof(Base))); }
  9. }
  10.  
  11. public class Base
  12. {
  13. }
  14.  
  15. public class Derived : Base
  16. {
  17. }
Success #stdin #stdout 0.03s 36968KB
stdin
Standard input is empty
stdout
True
False