Any way to _not_ call superclass constructor in Java?

后端 未结 13 1408
误落风尘
误落风尘 2020-12-15 04:16

If I have a class:

class A {
   public A() { }
}

and another

class B extends A {
   public B() { }
}

is t

13条回答
  •  余生分开走
    2020-12-15 04:19

    Every superclass needs to be constructed and there is no other way then calling a constructor.

提交回复
热议问题