只是一個簡單的問題,我似乎無法找到適合在線的答案。 當我有一個try/catch塊,並且想要發現錯誤時,應該使用System.err.println(...)還是應該使用throw new Exception(...)。 例如: if (null==userList || null==credentials)
System.err.println("Did you call login(
我有一個方法被另一個類調用,它在對象集合上執行許多步驟。具體而言,我將文件從其原始位置複製到新文件夾。文件複製完成後,我使用與該組文件相關的其他數據更新數據庫。它看起來是這樣的: public void copyFilesAndStore(File[] files, DataObject additionalData){
for (File f in files){
copy
代碼: catch (IOException e) {
LOGGER.error("IOException exception happened");
//now need throw again the same exception to be
//catched in the upper method
}
但是當我嘗試簡單: catch