📄 constructiondemo.java
字号:
class 房子{
int 面积;
public 房子(int 面积)
{
this.面积 = 面积;
System.out.println("房子的构造函数被调用");
}
}
class 楼房 extends 房子
{
public 楼房()
{
System.out.println("楼房的构造函数被调用");
}
}
class 写字楼 extends 楼房
{
public 写字楼()
{
super();
System.out.println("写字楼的构造函数被调用");
}
}
public class ConstructionDemo
{
public static void main(String arg[])
{
写字楼 中信 = new 写字楼();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -