private static String getBookByNumber(String[] books)throws Exception{
System.out.println();
System.out.println("输入书的序号:");
int num =input.nextInt();
for(int i = 0; i < books.length; i++) {
if (books[num-1].equals(books[i])){
return books[i];
}
}throw new Exception("图书不存在!");
}
肯定不会显示啊,你这段代码完全有问题的,加上try-catch