automaticconstructor.java
来自「JAVA编程思想第四版英文原版习题答案. pdf原版的」· Java 代码 · 共 17 行
JAVA
17 行
// initialization/AutomaticConstructor.java
// TIJ4 Chapter Initialization, Exercise 7, page 167
/* Create a class without a constructor, and then create an object of that
* class in main() to verify that the default constructor is automatically
* synthesized.
*/
class Aso {
void bark() {System.out.println("woof");}
}
public class AutomaticConstructor {
public static void main(String[] args) {
Aso a = new Aso();
a.bark();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?