employee.java
来自「国外的数据结构与算法分析用书」· Java 代码 · 共 24 行
JAVA
24 行
public class Employee
{
protected String name, address;
protected int employeeNumber;
// constructor that takes the name, address, and number
public Employee(String n, String a, int e)
{
name = n;
address = a;
employeeNumber = e;
}
// toString method to display the Employee attributes
public String toString()
{
String temp;
temp = "Employee name: " + name + "\n";
temp += "Employee number: " + employeeNumber + "\n";
temp += "Employee address: " + address + "\n";
return temp;
}
} // end of Employee class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?