Java Programming Chapter 4——Static code block

Static code block

1.static can be used to modify the initialization code block.

2. Initialize code block (dynamic code block)

3. Location: {} defined within the class and outside the method.

4. Function: When creating an object, complete the initialization of the attributes in the order defined by and attributes.

5. static code block: The initialized code block modified by static is called static code block.

6. Location: {} defined within the class and outside the method, and also modified by static.

7. Function: When the class is loaded, the initialization of static attributes is completed in the order defined by and static attributes.

相关推荐
是小蟹呀^1 小时前
Spring Security + JWT 面试题整理
java·jwt·springsecurity
星栈独行3 小时前
翻完 Pi 源码:它和 Codex、Claude Code 有何不同
开发语言·javascript·人工智能·程序人生
spencer_tseng3 小时前
Redis + Nacos.bat
java·windows·dos
qq_448011163 小时前
C语言中的变量和函数的定义与声明
android·c语言·开发语言
troyzhxu4 小时前
列表查询的 GraphQL —— 一行代码终结你的 if-else 地狱!
java·springboot·graphql
孫治AllenSun4 小时前
【DataX】生产环境搭建DataX集群案例
java·开发语言·jvm
c238565 小时前
把 C++ 内存分配拆透:new 与 malloc 的三层血缘
开发语言·c++·算法
好好沉淀5 小时前
@NotBlank(message = “{xxx}“) 注解中花括号的含义
java
fīɡЙtīиɡ ℡5 小时前
内存泄漏产生的原因
java·spring·servlet