December 1999
Intermediate to advanced
816 pages
20h 27m
English
The three examples so far have shown interrogating classes and interfaces from their class definitions. The methods used so far, such as getFields(), provide static information about what a class looks like. This is useful if you want to get information about what a class or interface contains. If you want to find out about an object and then use it, or find out what fields and methods a class contains so that you can make an instance of that class and modify its values or call its methods, you can use the methods provided by the Reflection APIs. First, you can create an object using a constructor, and then you can set or get attribute values or call methods. You can create an object in Java by calling ...
Read now
Unlock full access