In JLS 15.8.2, it says
A class literal is an expression consisting of the name of a class, interface, array, or primitive type, or the pseudo-type void, followed by a
.
and the tokenclass
.
And in WIKI, it says
An expression in a programming language is a combination of explicit values, constants, variables, operators, and functions...
And I didn't see any operator similar to it in here
I know that String.class
is an instance of Class<String>
, I just don't understand why on earth we can write an expression like this.
So what is .class
really and how to understand this notation?