天天看點

Unhandled Exxception “Unhandled exception type IOException”?

Unhandled Exxception  “Unhandled exception type IOException”?

在Android studio中,自動遇見這個異常報錯,如果eclipse會自動提示,但是AS提示很抽象,不容易發現,解決方案:

You should add "throws IOException" to your main method:

public static void main(String[] args) throws IOException {

You can read a bit more about checked exceptions (which are specific to Java) in JLS.