1
我看到很多人寫的一樣:如何在java中拋出SystemException?
try {
//something
}
catch (IOException e){
throw new SystemException("IO Error", e);
}
我"Cannot instantiate the type SystemException"
錯誤,似乎是SystemException的一個抽象類,我該怎麼能夠把它扔?
所以我可能應該寫在catch上的東西就像下面的東西?謝謝 e.printStackTrace(); 扔e; – Tokoyomi
@Tokoyomi - 是的,這是可能的。在較大的應用程序中,使用日誌記錄庫來允許更多日誌記錄選項。例如。 [log4j的](http://logging.apache.org/log4j/2.x/) – Alexei