Q:

Can we use “this” command within a static method?

0

Can we use “this” command within a static method?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

We can’t use ‘this’ in a static method because the keyword ‘this’ returns a reference to the current instance of the class containing it. Static methods (or any static member) do not belong to a particular instance. They exist without creating an instance of the class and are called with the name of a class, not by instance, so we can’t use this keyword in the body of static Methods.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Interview Questions and Answers,You Need To Know

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Explain Deadlock?... >>
<< What is the difference between constant and readon...