File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ tags:
4242
4343` Field[] getDeclaredFields() ` :获取当前类的所有field(不包括父类)
4444
45- !!! warning
45+ ::: warning
4646
4747注意:对于使用` Field getDeclaredField(name)``Field[] getDeclaredFields() ` 或获取的` private ` 修饰的Field在获取详细的内容时需要先设置 ` setAccessible(true) `
4848
49- !!!
49+ :::
5050
5151获取字段内容
5252``` java
@@ -118,11 +118,11 @@ public class Main {
118118` Class[] getInterfaces() ` :获取当前类实现的所有接口。
119119
120120通过Class对象的isAssignableFrom()方法可以判断一个向上转型是否可以实现。
121- !!! warning
121+ ::: warning
122122
123123当我们判断一个实例是否是某个类型时,正常情况下,使用instanceof操作符
124124
125- !!!
125+ :::
126126``` java
127127 // 判断B的类型能否转成A A.class.isAssignableFrom(B.class)
128128 父类. class. isAssignableFrom(子类. class)
@@ -131,11 +131,11 @@ public class Main {
131131
132132可以在运行期动态创建某个interface的实例。
133133
134- !!! warning
134+ ::: warning
135135
136136不要在 invoke 里调用 proxy.xxx(),因为调用proxy.xxx()会进入invoke(),一直递归
137137
138- !!!
138+ :::
139139
140140简单例子
141141``` java
You can’t perform that action at this time.
0 commit comments