📄 commandfactory.java
字号:
package agenda;
/**
*@author haha
*/
public class CommandFactory {
static public Command getCommand(String cmd) throws InstantiationException, IllegalAccessException, ClassNotFoundException
{
//Command result =(Command)Class.forName(cmd).newInstance();
Command result;
if(cmd.equals("register"))
result = new register();
else if(cmd.equals("add"))
result = new add();
else if(cmd.equals("query"))
result = new query();
else if(cmd.equals("delete"))
result = new delete();
else if(cmd.equals("clear"))
result = new clear();
else
result = new register();
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -