⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commandfactory.java

📁 采用面向对象方法和Java语言开发一个基于命令行交互方式的议程(agenda)管理系统
💻 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 + -