Java中的 static{ …… } 是什么意思?
2 回答

墨色风雨
TA贡献1853条经验 获得超6个赞
static是静态加载块。
解释:项目运行初始化过程会将static内部程序加载到内存中,不能有参数值等动态参数。
备注:一般都是加载数据库连接时候用来加载数据库驱动用的。
添加回答
举报
0/150
提交
取消