C#: Function in Function possible?

前端 未结 7 989
面向向阳花
面向向阳花 2020-12-05 05:59

Is it possible to declare a method within another method in C#?

For example like that:

void OuterMethod()
{
    int anything = 1;
    InnerMethod();          


        
7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 06:51

    Take a look at anonymous methods. I think that's what you're looking for.

提交回复
热议问题