?? booktypemanage.java
字號:
/**
@forlink 2006-2
********
*/
//package booktypemanage;
//import booktypemanage.*;
import java.io.*;
public class BookTypeManage
{
public static void main(String[] args)
{
BookType bt = new BookType();
String id ,name;
int Command;
/**
打印功能菜單
*/
System.out.println("請選擇您需要的命令:");
System.out.println("1:查詢!");
System.out.println("2:更新!");
Command = Console.readInt();
if(Command == 1) /* 書架查詢 */
{
int SelectMode;
System.out.println("請選擇您需要的查詢方式:");
System.out.println("1:按ID查詢!");
System.out.println("2:按name查詢!");
SelectMode =Console.readInt();
if(SelectMode == 1)
{
System.out.println("請輸入ID");
id = Console.readSting();
bt.setId(id);
bt.SelectBT(1);
}
else
if(SelectMode == 2)
{
System.out.println("請輸入name");
name = Console.readSting();
bt.setName(name);
bt.SelectBT(2);
}
}
else if(Command == 2) /*書架修改 */
{
System.out.println("請輸入需要修改的圖書類型的 id 及其 類型名");
id = Console.readSting();
name = Console.readSting();
//bt.UpdateBT(id,name);
UpdateBookTypeCommand Update_BT = new UpdateBookTypeCommand();
Update_BT.update(id,name);
}
}
}
class Console /*定義輸入控制*/
{
public static int readInt() /*定義整形輸入*/
{
int result=0 ;
try
{
String temp=new BufferedReader(new InputStreamReader(System.in)).readLine();
result=Integer.parseInt(temp);
}
catch(Exception e)
{
System.out.println("Error: "+e);
}
return result ;
}
public static String readSting() /*定義字符串輸入*/
{
String result=null ;
try
{
result=new BufferedReader(new InputStreamReader(System.in)).readLine();
}
catch(Exception e)
{
System.out.println("Error: "+e);
}
return result ;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -