While constructing the default constructor can not handle exception : type Exception thrown by implicit super constructor

后端 未结 4 573
独厮守ぢ
独厮守ぢ 2020-11-29 10:19

The code works fine until I try to make the code into a constructable class. When I attempt to construct an object from it I get the error

\"Default

4条回答
  •  我在风中等你
    2020-11-29 11:01

    Any subclass which extends a super class whose default constructor handles some exception, a subclass must have a default constructor which implements the exception

    class Super{ public Super() throws Exception {}}

    class Sub extends Super{public Sub()throws Exception{//}}

提交回复
热议问题