chap2-4.txt
来自「清华大学出版社经典教材系列」· 文本 代码 · 共 14 行
TXT
14 行
// 程序2-4
class Test { // 定义一个类
int Value; // 类中的变量未赋值,默认就是0
}
public class Test_Var{
public static void main(String [ ] args) {
int x=100; // 此处的x必须赋值,否则无法通过编译
Test obj=new Test( ); // 为对象赋值,后续章节将讲解该处代码的含义
System.out.println("obj.Value = "+ obj.Value +" x= "+x);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?