1. 리플렉션이란 ?

오라클의 자바 공식 문서에 의하면 다음과 같이 정의를 내리고 있다.

Reflection enables Java code to discover information about the fields, methods and constructors of loaded classes, and to use reflected fields, methods, and constructors to operate on their underlying counterparts, within security restrictions. The API accommodates applications that need access to either the public members of a target object (based on its runtime class) or the members declared by a given class. It also allows programs to suppress default reflective access control.

번역의 좀 해보면 “불러진 클래스의 메소드, 필드, 생성자에 대한 정보를 찾을 수 있는 자바 api로 public으로 선언된 부분이외에도 보안 제한을 준수하면서 숨겨진 중요 필드, 메소드, 생성자를 사용할 수 있게 하는 기능이다.”라고 의역을 할 수 있습니다.

자바 리플렉션으로 알 수 있는 정보들은 다음과 같습니다.

장점

단점