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(); |
Any idea why it's working and not giving any error?
Thanks,
Prakash


Shubham KumarRank #621 · 3.8K reputationPosted Apr 13, 2015, 11:11 PM EDT
your Class1 is public and you can make the Class1's object as static.