<aside> 📌 Class 클래스란?
</aside>
Class c = Class.forName("java.lang.String");
public static void main(String[] args) throws ClassNotFoundException {
Class<?> aClass = Class.forName("java.lang.String");
Constructor<?>[] constructors = aClass.getConstructors();
for (Constructor<?> cons : constructors) {
System.out.println(cons);
}
Method[] methods = aClass.getMethods();
for (Method method : methods) {
System.out.println(method);
}
}
Class c = String.class;
String s = new String();
Class c = s.getClass(); //Object 메서드
<aside> 📌 동적 로딩이란?
</aside>
<aside> 📌 Class의 newInstance() 메서드로 인스턴스 생성
</aside>