자바에서 커스텀 어노테이션을 만드는 방법은 다음과 같다. public @interface MyAnnotation { } 사실상 인터페이스 키워드에 @를 붙이면 되는 것인데. 이것을 곧바로 클래스, 필드, 메서드 같은 곳에 붙이면 어노테이션으로써의 껍데기 역할은 할 수 있게 된다. - @MyAnnotation 사용 예) @MyAnnotation public class MyMain{ public static void main(String[] args){ System.out.println("Hello World!"); } } @Retention 어노테이션 - Book 클래스 package org.example; @MyAnnotation public class Book { private static String..
리플렉션은 Class 타입으로 시작합니다. 도큐먼트 : https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html Class (Java Platform SE 8 ) Determines if the specified Class object represents a primitive type. There are nine predefined Class objects to represent the eight primitive types and void. These are created by the Java Virtual Machine, and have the same names as the primitive types tha docs.oracle.com 위의 ..