0
点赞
收藏
分享

微信扫一扫

Java敲代码时抛出的错误


1:
Default constructor cannot handle exception type UnknownHostException thrown by implicit super constructor. Must define an explicit constructor

翻译:默认构造函数无法处理隐式超级构造函数引发的异常类型UnnownHostException。必须定义显式构造函数

其实就是你写在类的成员中有异常,所以你得将这个成员变量的赋值放在一个方法里面,这样可以抛出异常


举报

相关推荐

0 条评论