Skip to content

Instantly share code, notes, and snippets.

@TryJSIL
Created April 27, 2012 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TryJSIL/2508482 to your computer and use it in GitHub Desktop.
Save TryJSIL/2508482 to your computer and use it in GitHub Desktop.
Closures
using System;
public static class Program {
public static void Main (string[] args) {
int x = 1;
string y = "y";
Func<string> a = () => {
return String.Format("x={0}, y={1}", x, y);
};
Console.WriteLine("a()={0}", a());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment