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.

相关推荐
risc1234561 小时前
Lucene80DocValuesConsumer 五种类型源码阅读顺序
java·服务器·前端
弹简特1 小时前
【Java项目-企悦抽】04-项目演示+项目源码+AI赋能整理接口文档
java·开发语言
郝学胜-神的一滴1 小时前
Qt 高级编程 034:深耕QWidget底层内核—彻底吃透无边框窗口设计核心原理
开发语言·c++·qt·程序人生·软件开发·用户界面
万亿少女的梦1682 小时前
基于Spring Boot的楚雄旅游景区门票售卖系统设计与实现
java·spring boot·mysql·vue·系统设计
不会写代码的ys2 小时前
C++复习篇
java·开发语言·c++
雨师@2 小时前
go语言项目--实例化(图书管理)--005
开发语言·后端·golang
Aspiresky2 小时前
探索Rust语言之引用
开发语言·后端·rust
天空'之城2 小时前
Linux 系统编程 10:线程同步
linux·开发语言·系统编程·线程同步
Vect__2 小时前
Go 数据结构 slice 深度剖析
开发语言·数据结构·golang