Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SingleDelegate
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { delegate int ArithOp(int x,int y); class MathOperation { public static int Add(int a,int b) { return(a + b); } public static int Sub(int a,int b) { return(a - b); } class DelegateTest { public static void main( ) { ArithOp op1 = new ArithOp(MathOperation.Add); ArithOp op2 = new ArithOp(MathOperation.Sub); int result1 = op1(100,200); int result2 = op2(500,200); Console.WriteLine("RESULT1 ="+result1); Console.WriteLine("RESULT2 ="+result2); } } } }
run
|
edit
|
history
|
help
0
a5
hello,world
Hex_Base64
Secure random string
Ejemplos polimorfismos con interfaces y posibles usos sencillos c#
Project Euler Problem 8
Palindrome
Math 5.83b
346625
Four Digit Number