找出初始化的内容和顺序。设置断点并使用调试程序。
更正数据初始化的顺序以获得以下结果:
static void init()
Static 块
public static void main
非 Static 块
static void printAllFields
0
null
Solution 构造方法
static void printAllFields
6
名称
加载变量的顺序
- 8
已锁定
评论 (5)
- 受欢迎
- 新
- 旧
你必须先登录才能发表评论
Anonymous #10852681
27 十月 2021, 00:51
类执行顺序:类的静态代码块→main()函数→构造代码块→构造器
0
Xu Yang
30 七月 2020, 02:18
HELP
0
Roman
31 七月 2020, 05:59
Please refer to Help section at our course.
0
null
17 三月 2021, 01:52
非 Static 块 和 名称 似乎应该是 非 static 块 和 姓氏
0
sky
21 八月 2022, 08:52
是的感觉翻译有毒
+1