Mega Code Archive

 
Categories / Java Tutorial / Reflection
 

Checking whether String is an interface or class

public class Main {   public static void main(String[] argv) throws Exception {     Class clazz = String.class;     boolean isInterface = clazz.isInterface();     System.out.println("Is Interface = " + isInterface);   } }