Dealing with modifiers

Previously, you’ve learned how to find all the constructors, methods and fields that were declared in the class by using reflection, even if some of them are private. But what is the point of Method, Field and Constructor classes if you don’t know how to use them for more complex actions, that are more difficult than finding out the name of the method? Actually, these…

Retrieving Class instances

The java.lang.Class takes a central place in the reflection package. It represents a structure of classes and interfaces by aggregating information on constructors, fields, methods, superclasses, interfaces, and so on. In other words, if you have an instance of a class of a specific type, you can obtain all information about the type. That’s why java.lang.Class is so important.