import java.lang.reflect.*; public class Refl5 { public static void printModifiers(String name) { try { Class c =Class.forName(name); int x=c.getModifiers(); System.out.println("x value is"+x); if(Modifier.isPublic(x)) System.out.println("\t public"); if(Modifier.isFinal(x)) System.out.println("\t final"); if(Modifier.isAbstract(x)) System.out.println("\t Abstract"); } catch(ClassNotFoundException cnf) { cnf.printStackTrace(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String args[]) { printModifiers(args[0]); } }