Anonymous methods can be assigned a signature, which is appended to the delegate keyword.
using System; using System.Threading;
public delegate int DelegateClass(out int param);
public class Starter { public static void Main() { int var;
DelegateClass del = delegate(out int inner) {
inner = 12;
Console.WriteLine("Running anonymous method"); return inner;
};
del(out var);
Console.WriteLine("Var is {0}", var);
}
}