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.

相关推荐
麦麦麦当劳大王7 分钟前
【油猴脚本】Boss直聘 岗位职责复制
开发语言·前端·javascript
starzy199023 分钟前
深入理解Scala Map:从实现原理到工程实践
开发语言·后端·scala
只睡四小时1 小时前
Three.js Sub-tick:漏判 60.7%→0
开发语言·javascript·性能优化·ecmascript·游戏开发·three.js·碰撞检测
码农小河662 小时前
基于SSM+JSP的高校专业信息管理系统【附源码+数据库】
java·开发语言·数据库
东鹏特饮4 小时前
系统运维(传统/通用运维)面试题
开发语言·php
风若飞4 小时前
Spring Ai 入门遇到问题1
java·后端·spring
今天要早睡_4 小时前
C++01_入门基础复习
开发语言·c++
Nuanyt4 小时前
LeetCode Hot 100 链表专题(五)· 2 题(Java)
java·算法·leetcode·链表
黑马程序员毕设5 小时前
基于 Java 的餐饮点餐系统设计与应用报告
java·开发语言
SL_staff5 小时前
从文档工具到知识中枢:基于JVS数字底座构建企业级统一内容管理平台的技术实践
java·开源·全栈