File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ static {
83
83
84
84
一个类中的静态代码块可以有多个,位置可以随便放,它不在任何的方法体内,JVM 加载类时会执行这些静态的代码块,如果静态代码块有多个,JVM 将按照它们在类中出现的先后顺序依次执行它们,每个代码块只会被执行一次。
85
85
86
- ! [enter image description here](httpsimg -blog.csdn.net20180107161309133watermark2textaHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hlbjEzNTc5ODY3ODMxfont5a6L5L2Tfontsize400fillI0JBQkFCMA==dissolve70gravitySouthEast )
86
+ ! [](http : // my -blog-to-use.oss-cn-beijing.aliyuncs.com/18-9-14/88531075.jpg )
87
87
88
88
静态代码块对于定义在它之后的静态变量,可以赋值,但是不能访问.
89
89
@@ -238,4 +238,4 @@ public class Test {
238
238
239
239
- httpsblog.csdn.netchen13579867831articledetails78995480
240
240
- httpwww.cnblogs.comchenssyp3388487.html
241
- - httpwww.cnblogs.comQian123p5713440.html
241
+ - httpwww.cnblogs.comQian123p5713440.html
You can’t perform that action at this time.
0 commit comments