What exactly is the meaning of the following construction: MyClassName.class
?
At first I thought MyClassName.class
would represent the access of a static class variable defined for MyClassName
class, but it that'd be true then the following assignment should be possible:
MyClassName m = new MyClassName();
Class<MyClassName> clazz = m.class; //access static class variable by using an instance variable
What is the true meaning of MyClassName.class
? Is it a static class variable? is it a Java special construction?