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 iOS开发
@try{}@catch (NSException *exception) {}在object c中的应用及问题
@try{}@catch (NSException *exception) {}在object c中的应用及问题
34 0
|
程序员
解决报错Exception encountered during context initialization
程序员不是在去生产bug的路上,那就是在去解决bug的路上。
125 1
|
Java
Exception 和 Error 有什么区别?
Java 平台对不同的异常进行了分类,具体被分为了 Exception 和 Error,他们都是继承了 Throwable 类。
92 0
Exception 和 Error 有什么区别?
|
存储 前端开发 Java
Exception 和 Error
Exception 和 Error
82 0
|
安全 Java 数据库连接
Exception和Error有什么区别吗
Exception和Error有什么区别吗
212 1
|
安全 Java 程序员
Exception和Error的区别
Exception和Error的
186 0
Exception和Error 有什么区别
Exception和Error 有什么区别
135 0
Exception和Error 有什么区别
|
安全
Error、Exception区别
Error、Exception区别
108 0
Error和Exception有什么区别?(还在总结)
Error表示系统级的错误和程序不必处理的异常,是恢复不是不可能但很困难的情况下的一种严重问题;比如内存溢出,不可能指望程序能处理这样的情况;Exception表示需要捕捉或者需要程序进行处理的异常,是一种设计或实现问题;也就是说,它表示如果程序运行正常,从不会发生的情况。
1026 0
|
Linux C# Windows
【C#】简单解决PathTooLong的Exception
原文:【C#】简单解决PathTooLong的Exception 前提 windows系统路径的最大长度限制是260个字符(听说.Net 4.6.2,取消了这个限制),而Linux或者Unix系统的好像是4K个字符。
1009 0