fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. object value = "this is a string!";
  8. print(value); // prints: "Got object!"" instead of "Got string!""
  9. }
  10.  
  11. static void print(string value)
  12. {
  13. Console.WriteLine("Got string!");
  14. }
  15.  
  16. static void print(object value)
  17. {
  18. Console.WriteLine("Got object!");
  19. }
  20. }
  21.  
Success #stdin #stdout 0.01s 131520KB
stdin
Standard input is empty
stdout
Got object!