我已经声明了这样的注释:
public @interface CustomAnnot
{
String[] author() default "me";
String description() default "";
}
因此,一个有效的注释将是
@CustomAnnot(author="author1", description="test")
我想不通的是,如何设置多个作者,因为 author() 有 return String[] 这应该是可能的。
@CustomAnnot(author="author1","autor2", description="test")
不工作!
author={"author1","autor2"}
像这样做:
public @interface CustomAnnot {
String[] author() default "me";
String description() default "";
}
还有你的注释:
@CustomAnnot(author={"author1","author2"}, description="test")
不定期副业成功案例分享