fork download
  1. using System;
  2.  
  3. enum Cat {
  4. Mine,
  5. Yours,
  6. Other
  7. }
  8.  
  9. enum Dog {
  10. Yours,
  11. Mine,
  12. Other
  13. }
  14.  
  15. public class Test
  16. {
  17. public static void Main()
  18. {
  19. Cat cat = Cat.Mine;
  20. Object whoKnows = cat;
  21. Cat otherCat = (Cat)whoKnows;
  22. Dog secretCat = (Dog)whoKnows;
  23. Console.WriteLine(cat.GetType() + ", " + otherCat.GetType() + ", " + secretCat.GetType());
  24. }
  25. }
Success #stdin #stdout 0.03s 23912KB
stdin
Standard input is empty
stdout
Cat, Cat, Dog