cs1593.cs 405 B

123456789101112131415161718192021222324252627282930
  1. // cs1593.cs : Delegate 'Blah.MyDelegate' does not take '1' arguments
  2. // Line : 21
  3. using System;
  4. public class Blah {
  5. public delegate int MyDelegate (int i, int j);
  6. public int Foo (int i, int j)
  7. {
  8. return i+j;
  9. }
  10. public static int Main ()
  11. {
  12. Blah i = new Blah ();
  13. MyDelegate del = new MyDelegate (i.Foo);
  14. int number = del (2);
  15. if (number == 5)
  16. return 0;
  17. else
  18. return 1;
  19. }
  20. }