interfacebuilder.java

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

JAVA
18
字号
package Commands;

import Interfaces.*;

/**	Build the correct interface for the person logging in.  */
public class InterfaceBuilder
{
	/**	An interface corresponding to the login id.
		Analysis: Time = O(1) */
	public static StaffInterface get(int id)
	{
		if (id > 0 && id < 100)
			return new AdminInterface();
		else 
			return new TellerInterface();
	}
}

⌨️ 快捷键说明

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