December 1999
Intermediate to advanced
816 pages
20h 27m
English
Just as you can retrieve information on a class, you can use the Reflection APIs to interrogate an interface. You can find out what interfaces it extends, what methods it declares, and the data members it defines.
Because there are so many important interfaces, and because your object, like the RemoteObject in Listing 13.1, may implement one or more interfaces, it is important to be able to use reflection on interfaces. Listing 13.3 shows a program to interrogate an interface. This code is similar to the two previous examples.
import java.lang.reflect.*; class ClassBrowser3 { public boolean ... |
Read now
Unlock full access