📄 variable.java
字号:
/*
* 吕渊 200532580144
* 使用工具:eclipse
* Java SE 6
*/
//存储int型变量的类
public final class Variable {
//int型变量名
protected String name = "";
//时候初始化
protected boolean evaluated = false;
//变量值
protected int value = 0;
//不进行初始化的构造方法
public Variable(String name) {
this.name = name;
}
//进行初始化的构造方法
public Variable(String name, int value) {
this.name = name;
this.value = value;
this.evaluated = true;
}
//设置变量值
public void setValue(int value) {
this.value = value;
this.evaluated = true;
}
//获取变量值
public int getValue() {
return value;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -