Unhandled Exxception “Unhandled exception type IOException”?

简介: Unhandled Exxception  “Unhandled exception type IOException”? 在Android studio中,自动遇见这个异常报错,如果eclipse会自动提示,但是AS提示很抽象,不容易发现,解决方案: You should add "thr...

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.

  

目录
相关文章
|
4月前
|
Java 程序员 编译器
java异常处理,什么是Checked Exception和Unchecked Exception?
java异常处理,什么是Checked Exception和Unchecked Exception?
29 0
|
10月前
|
存储 前端开发 Java
Exception 和 Error
Exception 和 Error
65 0
|
10月前
|
Java
Exception 和 Error 有什么区别?
Java 平台对不同的异常进行了分类,具体被分为了 Exception 和 Error,他们都是继承了 Throwable 类。
67 0
Exception 和 Error 有什么区别?
|
安全 Java 程序员
Exception和Error的区别
Exception和Error的
135 0
|
安全
Error、Exception区别
Error、Exception区别
|
安全 Java 数据库连接
Exception和Error有什么区别吗
Exception和Error有什么区别吗
188 1
Exception和Error 有什么区别
Exception和Error 有什么区别
119 0
Exception和Error 有什么区别
Error和Exception有什么区别?(还在总结)
Error表示系统级的错误和程序不必处理的异常,是恢复不是不可能但很困难的情况下的一种严重问题;比如内存溢出,不可能指望程序能处理这样的情况;Exception表示需要捕捉或者需要程序进行处理的异常,是一种设计或实现问题;也就是说,它表示如果程序运行正常,从不会发生的情况。
1009 0
|
Linux C# Windows
【C#】简单解决PathTooLong的Exception
原文:【C#】简单解决PathTooLong的Exception 前提 windows系统路径的最大长度限制是260个字符(听说.Net 4.6.2,取消了这个限制),而Linux或者Unix系统的好像是4K个字符。
972 0