从 Class中获取信息 Class c= Class. forName(args[o]) //取得套件代表对象 Package p getPackage( System. out. printf( package sion",p getName())i //取得型态修饰’像是c1ass丶 interface nt m retModifiers ( System. out.print(Modifier tostring(m)+)i //如果是接口 if(Modifier. isInterface(m)) System. out. print(interface)i e⊥se System. out. print (" class )i System. out. println(c getName()+ f")从Class中获取信息 Class c = Class.forName(args[0]); //取得套件代表对象 Package p = c.getPackage(); System.out.printf("package %s;%n", p.getName()); //取得型态修饰,像是class、interface int m = c.getModifiers(); System.out.print(Modifier.toString(m) + " "); //如果是接口 if(Modifier.isInterface(m)) { System.out.print("interface "); } else { System.out.print("class "); } System.out.println(c.getName() + " {");