您的位置:首页 > 其它

使用lsyncd实时同步.

2015-07-29 15:00 411 查看
package mypackage;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@interface TestAnnotation {

public int id() default 5;
public String description();
}
class Anno
{

@TestAnnotation( id =6 )
public void g() {}
@TestAnnotation( id =7 )
protected void i() {}
@TestAnnotation( id =8 )
void f(){}
@TestAnnotation( id =9 )
private void h() {}
}
public class Test {

public static void main(String[] args) {

Method[] methods = Anno.class.getMethods();

for (Method m : methods) {
TestAnnotation a = m.getAnnotation(TestAnnotation.class);
// System.out.print(m.getName());
if (a != null)
System.out.print(a.id());
}
}

}

 

请问以上程序的输出是:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: