java.lang.Class

This lesson covers the class java.lang.Class which is an important type when using reflection.

We'll cover the following...

Question # 1

Why is java.lang.Class important?

The entry point for all reflection operations is java.lang.Class. For every type of object, the JVM instantiates an immutable instance of java.lang.Class which provides methods to examine the runtime properties of the object including its members and type information. Class also provides the ability to create new classes and objects.

Question # 2

How can we get the class object for a reference type?

When an instance of a reference type is available, ...