📄 usemyannotationmethod2.java
字号:
import java.lang.reflect.*;
public class usemyannotationmethod2
{
public static void main(String[] args)
{
try{
Class myclass=Class.forName("classuserAnnotation");
Method[] all_method=myclass.getDeclaredMethods();
for(Method m:all_method)
{
if(m.isAnnotationPresent(myfirstAnotation.class))
{
myfirstAnotation myanno=m.getAnnotation(myfirstAnotation.class);
System.out.println(myanno.name());
System.out.println(myanno.description());
System.out.println(myanno.date());
System.out.println(myanno.id());
}
}
}
catch(Exception e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -