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.

相关推荐
黑马程序员毕设30 分钟前
基于Java的医院药品管理系统的优化设计与实现
java·开发语言·spring boot·小程序·架构·课程设计·毕设
木井巳34 分钟前
【BFS/DFS 解决 FloodFill 算法】太平洋大西洋水流问题
java·算法·leetcode·深度优先·广度优先·宽度优先·推荐算法
白山编程大哥1 小时前
Java 集合算法:从排序、查找到底层原理的实战指南
java·python·算法
_Twink1e1 小时前
openJiuwen 实训营 Day 1 · WorkSwarm 入门教程
开发语言·c++·openjiuwen
devpotato1 小时前
缓存与数据库更新顺序不一致问题
java·数据库·redis
问天_观心1 小时前
大模型微调学习(一)
开发语言·人工智能·学习·语言模型·github
阿里嘎多学长1 小时前
2026-09-03 GitHub 热点项目精选
开发语言·程序员·github·代码托管
xcl09251 小时前
酒馆预约系统开发实战:从需求分析到上线全流程指南
java·spring boot·需求分析
Kyrie_kk2 小时前
Java--IO--Path文件访问
java·后端
qinqinzqq2 小时前
Maven POM 格式、Schema 与 XSD:一篇讲透
java·maven