| Using the Core Reflection API |
|
Reflective code can use Java's richer set of class constants |
|
|
|
Get a handle on any type T you can name
with the class literal syntax: T.class
|
|
|
Class literals can refer to primitive types also:
int.class, char.class
|
|
|
Primitive types are represented using built-in constants:
Integer.TYPE, Character.TYPE
|
|
|
Anonymous array synopsis:
T a[] = ( new T[] { x, y, ... } );
|