// 클래스 멤버 변수, 멤버 메소드 출력하기
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class Java_Test02 {
public static void main(String[] args) throws ClassNotFoundException {
try {
// 찾으려면 클래스명을 정확하게 입력한다.
// 그렇지않으면 예외가 발생할 것이다.
Class cls = Class.forName("java.lang.Integer");
System.out.println("cls = " + cls);
Field[] fid1 = cls.getFields();
Method[] fid2 = cls.getMethods();
for(int i=0; i<fid1.length; i++)
System.out.println(i + " : " + fid1[i].getName());
System.out.println();
for(int i=0; i<fid2.length; i++)
System.out.println(i + " : " + fid2[i].getName());
} catch (Exception e) {
e.printStackTrace();
}
}