public class Test {
public static boolean a;
public void ex() throws MyException{
if (a == false){
throw new MyException("输入有误,请重新输入");
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("输入1表示按照书名查找书籍,输入2表示按照书的序号查找书籍");
Scanner input = new Scanner(System.in);
int a = input.nextInt();
if (a == 1){
System.out.println("请输入书籍名称");
Scanner input1 = new Scanner(System.in);
String b = input1.toString();
switch (b) {
case "高数":
System.out.println(new Book().getBook1());
break;
case "数据结构":
System.out.println(new Book().getBood2());
break;
default:
Test.a = false;
break;
}
}
}
}
botao555
相关分类