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.

相关推荐
饮水桶_T1 小时前
Git笔记
开发语言·笔记·算法
国科安芯1 小时前
让每一瓦热都听话:航天器主动热控系统CANFD控制网络的可靠性设计
开发语言·网络·单片机·嵌入式硬件·信息与通信·抗辐射·载荷
CoderYanger1 小时前
Java EE 进阶:12.Spring AOP(第一弹)
java·开发语言·spring boot·后端·spring·java-ee·交互
松仔log1 小时前
Kotlin中级——KMP
android·开发语言·kotlin
H H.2 小时前
Java笔记:String字符串
java·开发语言·经验分享·笔记·其他
Rain的Java大神之路2 小时前
Spring AI 还是 LangChain4j?2026 年 Java 接入大模型,我把这笔「架构赌注」的账算清楚了
java·后端·ai编程
鲸渔2 小时前
【AI Agent系列课程26-Python 基础26】复盘:Python 接口开发知识清单
开发语言·python·ai编程
用户112936112192 小时前
注释掉的接口为什么还能访问?没有 Git 也能证明改动有没有进产物
java
sharemylove3 小时前
Java 异常处理 学习笔记
java·开发语言·经验分享·笔记·学习
西西弗Sisyphus3 小时前
Qt QML 程序是怎么跑起来的(1)qml-only
开发语言·c++·qt