import java.io.*;
public class Test{
// 这个实例变量对子类可见
public String key;
// 私有变量,仅在该类可见
private double value;
//在构造器中对key赋值
public Test (String empName){
key = empName;
}
//设定value的值
public void setSalary(double empSal){
value = empSal;
}
// 打印信息
public void printEmp(){
System.out.println("键 : " + key );
System.out.println("值 : " + value);
}
public static void main(String args[]){
Test empOne = new Test("RUNOOB");
empOne.setSalary(1000);
empOne.printEmp();
}
}