如果列表为空,我对抛出哪个异常有以下疑问
public class XYZ implements Runnable {
private List<File> contractFileList;
@Override
public void run() {
contractFileList = some method that will return the list;
//now i want to check if returned contractFile is empty or not , if yes then raise the exception
if (contractFileList.isEmpty()) {
// throw new ?????
}
}
}
我在批处理中运行此代码,我想抛出一些异常来停止批处理执行。