Are anonymous methods defined inline?
问题 Are anonymous methods defined inline ? In the example below, the delegate object "d" is having reference of an anonymous method, which is accessing "x" variable which is defined in the Fun method. The scope of "x" should be limited to Fun method, but when we call MyFun, which invokes the delegate passed as parameter and increments the value of "x". The output comes out to be "6", how does this happen ? How the value of "x", or in first place "x" variable itself was available in the anonymous