this == null inside .NET instance method - why is that possible?

后端 未结 5 864
别那么骄傲
别那么骄傲 2020-12-14 15:22

I\'ve always thought that it\'s impossible for this to be null inside instance method body. Following simple program demonstrates that it is possible. Is this s

5条回答
  •  长情又很酷
    2020-12-14 15:44

    Try the documentation for Delegate.CreateDelegate() at msdn.

    You're "manually" calling everything, and thus instead of passing an instance in for the this pointer, you're passing null. So it can happen, but you have to try really really hard.

提交回复
热议问题