Java非法启动类型?

问题描述

| 我有这个:
class undefinedException extends Exception {
     super(\"Its not defined!\");
}
但我得到: 类型的非法开始 怎么了? 谢谢     

解决方法

        它应该是
class UndefinedException extends Exception {

       public UndefinedException() {
          super(\"Its not defined!\");
       }

}
    ,        您需要将
super
调用放入构造函数中。     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...