Question : What can be the C# equivalent of Java Class.this ?
Why : Suppose I've same class Form1 in both Java and C#. In Java we can write Form1.this, how this can be written in C#.
There is no equivalent, C# has no nested class support where it also tracks outer instances. If needed you pass a pointer yourself and store it in a field/property.
If all you want is the normal this to reference members in the same instance, simply use the this keyword. Or even better, don't -- it's implied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With