分类：电脑/网络-程序设计-JAVA相关
问题：Java编程题编写显示员工id和员工姓名的程序。使用两个类，第一 
编写显示员工id和员工姓名的。使用两个类，第一个类包括用来设置员工的id和姓名和单独的方法；另一个类创建员工对象，并使用对象调用方法。创建若干员工并显示他们的数据。
回答：/* *employeeTest. */class employee{private String id,name;public employee(){this("","");}public employee(String strId){this(strId,"");}public employee(String strId,String strName){id=strId;name=strName;}public void setId(String strId){id=strId;}public void setName(String strName){name=strName;}public String getId(){return id;}public String getName(){return name;}public String toString(){return "employee "+id+" name: "+name;}}public class employeeTest{public static void main(String[] args){employee employee1,employee2,employee3;employee1=new employee();employee2=new employee("cau");employee3=new employee("cau_yt","yinser");System.out.println(employee1);System.out.println(employee2);System.out.println(employee3);}}