Reputation: 105
Is there a way to refer java to the current class in a static method? I usually use the word "this", but this is obviously not working.. Any help?
Upvotes: 0
Views: 67
Reputation: 44439
this
points to the current instance, not the current class.
For this reason, this
will never work in a static
context.
If you want to use the current class, you'll have to explicitly name it as MyClass
.
Upvotes: 3