为什么我写的注解类注解值不能在使用该注解的类中获取?

比如有一个注解:

package testUseAnnotation;

//(1)

public @interface MyAnnotation {
    String value() default "注解的默认值";
}

下面是注解的使用类
package testUseAnnotation;

import java.lang.annotation.Annotation;

@MyAnnotation(value = "注解的应用值")
public class TestUseAnnotation {
    public static void main(String[] args) {
           
          MyAnnotation mAnnotation = TestUseAnnotation.class.getAnnotation(MyAnnotation.class);
         System.out.println( mAnnotation.value());//(2)
    
           
        }
}

运行上面的TestUseAnnotation类是不能在代码(2)处输出mAnnotation.value值的;会报错

为什么我写的注解类注解值不能在使用该注解的类中获取?

因为需要在代码(1)处加上

@Target(ElementType.TYPE)  
@Retention(RetentionPolicy.RUNTIME)

完整的注解写法如下:

为什么我写的注解类注解值不能在使用该注解的类中获取?