What does .class
mean in, for example, MyClass.class
? I understand that when you put the name of a class and the point it is used to access its sta
You can add .class
to the name of any class to retrieve an instance of its Class object.
When you use Integer.class
you reference an instance of Class
, which is a typed class object.
I always thought this was a field member that got added by the compiler, but it looks like it's really just syntactic sugar.