Java中的静态块前几天我在查看一些代码时,偶然发现:static {
...}来自C+,我不知道为什么会出现这种情况。这不是错误,因为代码编译得很好。这是什么“静态”代码块?
3 回答
DIEA
TA贡献1820条经验 获得超3个赞
public class Foo {
{
// This code will be executed before every constructor
// but after the call to super()
}
Foo() {
}}添加回答
举报
0/150
提交
取消
