For the primitive tipe the interface will be an empty array : Object « Reflection « Java
- Java
- Reflection
- Object
For the primitive tipe the interface will be an empty array
import java.util.Calendar;
import java.util.Date;
public class Main {
public static void main(String[] args) {
Date date = Calendar.getInstance().getTime();
Class c = char.class;
Class[] interfaces = c.getInterfaces();
for (Class intf : interfaces) {
System.out.println("Interface Name = " + intf.getName());
}
}
}
Related examples in the same category