Prakash Tripathi

Prakash Tripathi

  • 28
  • 40.8k
  • 6.3m

Question about static object

Apr 13 2015 11:42 AM
hi guys,
 
I have a question, I have seen variable declaration like below and wondering why/how it's working. I was expecting an error and both new and static keywords are used together.
 
static Class1 obj = new Class1();
obj.SomeMethod();
 
Any idea why it's working and not giving any error?
 
Thanks,
Prakash

Answers (1)