In this section you will learn how to
retrieve an Interface (that included in the program) by using the
getInterfaces() method. Here is an example that provides the
usage of the getInterfaces() method in more detail.
Create an object of class Finterface and assign it with
java.util.Integer.class.. Now retrieve Interfaces (included in the program)
and store their references in an array of class Class by using the getInterfaces() method.
Here is the code of the Example :
Finterface.java:
import java.lang.reflect.*;
|
Here is the output of this Example :
| C:\roseindia>javac Finterface.java C:\roseindia>java Finterface interface java.util.Collection |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Getting the implemented Interfaces
Post your Comment