Its a well known fact that a static method can work only on static members.
public static void Main()
{
Test t1 = new Test();
}
Here the Main method is static, but I haven’t declared t1 as static. Is it implicitly static?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it’s a local variable. Local variables behave the same way whether they’re declared in static methods or instance methods.
As a very rough guide (captured variables etc introduce complications):