Mega Code Archive

 
Categories / Java / Reflection
 

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());     }   } }