runtime 시 특정 클래스를 생성하여 사용할 때,
즉. String을 class로 생성할 때 자바의 refletction 기능을 이용하면 된다.
reflection은
Class Method Field |
를 이용하면 된다.
Class klass = Object.class; //class를 가져온다.
Object instance = klass.newInstane();// instance를 해야 class를 사용할 수 있다.
'JAVA' 카테고리의 다른 글
Queue (0) | 2014.04.07 |
---|---|
Sleep (0) | 2013.08.23 |
한글 초성 중성, 종성 (0) | 2013.03.14 |