in C# gibt es lokale Unterprogramme:
int x = 3; Func <int,int> f = y => x + y; Console.WriteLine (f(4));
in Java gibt es keine lokalen Unterprogramme,
aber innere Klassen.
int foo = 3;
ActionListener al = new ActionListener() {
void actionPerformed() {
System.out.println (foo);
}
}