Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/com/annotation/test/Child.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.annotation.test;

@Description(desc="这是类注解",author="ashuo",age=23)
@Description(desc="这是类注解",author="alex",age=26)
public class Child implements Person{

@Override
@Description(desc="这是方法注解",author="ashuo",age=23)
@Description(desc="这是方法注解",author="alex",age=26)
public String name() {
// TODO Auto-generated method stub
return null;
Expand Down
3 changes: 2 additions & 1 deletion src/com/annotation/test/ReflectAnn.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.lang.reflect.Method;

public class ReflectAnn {

public static void main(String[] args) {
//1.使用类加载器加载类
try {
Expand All @@ -26,7 +27,7 @@ public static void main(String[] args) {
}
}

//另一种解析方式
//5.另一种解析方式
for (Method method : m) {
Annotation[] as=method.getAnnotations();
for (Annotation annotation : as) {
Expand Down