Skip to content

Commit d792879

Browse files
committed
field from super class
1 parent ba47232 commit d792879

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

.idea/workspace.xml

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

my-app/src/main/java/com/mycompany/app/App.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ public static void main( String[] args ) throws ClassNotFoundException {
1212

1313
Class cl = Class.forName("com.mycompany.app.Test");
1414
try {
15-
Field field_01 =cl.getDeclaredField("int_01"); //所有
16-
Field field_03 =cl.getField("int_01");//NoSuchFileException int_01 不是 public
17-
Field field_02 =cl.getField("str_01");
18-
15+
Field field_01 =cl.getDeclaredField("int_01"); //所有3
16+
// Field field_02 =cl.getField("int_01");//NoSuchFileException int_01 不是 public
17+
Field field_03 =cl.getField("str_01");
18+
Field field_04 =cl.getField("intSuper");
1919
System.out.println(field_01.getName());
20-
System.out.println(field_02.getName());
20+
// System.out.println(field_02.getName());
2121
} catch (NoSuchFieldException e) {
2222
e.printStackTrace();
2323
}

my-app/src/main/java/com/mycompany/app/TestSuper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
* Created by infosea on 2016/1/28.
55
*/
66
public class TestSuper {
7-
int intSuper =0;
7+
public int intSuper =0;
88
}
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)