Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b39389e

Browse files
Merge branch 'master' of https://github.com/Snailclimb/JavaGuide
2 parents 71ad981 + 365afd6 commit b39389e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎docs/java/basic/reflection.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ I love JavaGuide
104104
value is JavaGuide
105105
```
106106

107+
**注意** : 有读者提到上面代码运行会抛出 `ClassNotFoundException` 异常,具体原因是你没有下面把这段代码的包名替换成自己创建的 `TargetObject` 所在的包 。
108+
109+
```java
110+
Class<?> tagetClass = Class.forName("cn.javaguide.TargetObject");
111+
```
112+
113+
107114
### 静态编译和动态编译
108115

109116
- **静态编译:** 在编译时确定类型,绑定对象

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /