employee.java

来自「国外的数据结构与算法分析用书」· Java 代码 · 共 37 行

JAVA
37
字号
package sequentialProcessing;

import java.io.*; 

/**	An employee with a name, number, hourly wage and classification. */
public class Employee implements Serializable
{
	/**	The name of the employee. */
	public String name;

	/**	The employee number. */
	public int number;

	/**	The hourly pay rate for the employee. */
	public float rate;

	/**	The classification of the employee. */
	public String classification;

	/**	Construct a new employee. 
		Analysis: Time = O(1) */
	public Employee(String newName, int newNumber, float newRate, String newClassification)
	{
		name = newName;
		number = newNumber;
		rate = newRate;
		classification = newClassification;
	}

	/**String representation of the meployee. 
		Analysis: Time = O(1) */
	public String toString()
	{
		return name + " " + number + " " + rate + " " + classification;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?