fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. interface Foo {
  6. void Bar(int a, int b = 1);
  7. }
  8. class FooImpl : Foo {
  9. public void Bar(int a, int b) {
  10. Console.WriteLine("bar/2");
  11. }
  12. public void Bar(int a) {
  13. Console.WriteLine("bar/1");
  14. }
  15. }
  16.  
  17. public static void Main()
  18. {
  19. Foo f1 = new FooImpl();
  20. f1.Bar(1);
  21. FooImpl f2 = new FooImpl();
  22. f2.Bar(1);
  23. }
  24. }
Success #stdin #stdout 0.03s 23920KB
stdin
Standard input is empty
stdout
bar/2
bar/1