2
我的信息从文本文件阅读,我想我的代码抛出如果读取的是无效类型,则为异常。但是,我想不出如何让我的程序继续异常被发现
while(input.hasNext()) {
try{
type = input.next();
name = input.next();
year = input.nextInt();
} catch(InputMismatchException ex)
{
//System.out.println("** Error: Invalid input **");
//code to make program continue
}
}