📄 cat.java
字号:
package demo.chapter05.statics;
public class Cat extends Animal {
static int id = idValue();
public static int idValue() {
System.out.println("cat id 实例化..."); // 3
return 0;
}
static {
System.out.println("cat static 代码块..."); // 4
}
{
System.out.println("猫的普通代码块"); // 7
}
public Cat() {
System.out.println("猫的无参构造器"); // 8
}
public Cat(String name) {
this();
System.out.println("猫的有参构造器: " + name); // 9
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -