Related: How do I create a static local variable in Java?
Pardon if this is a duplicate; I was pretty sure this would have been
Three years later...
You can approximate it with a captured local variable.
class MyNose
{
private static void Main()
{
var myNose= new MyNose();
var nosePicker = myNose.CreatePicker();
var x = nosePicker();
var y = nosePicker();
var z = nosePicker();
}
public Func CreatePicker()
{
int boog = 0;
return () => boog++;
}
}