Why are constructors not inherited in java?

后端 未结 12 1324
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 14:24

I am a beginner in java programming language, recently I have studied that constructors can not be inherited in java, Can anyone please explain why<

12条回答
  •  甜味超标
    2020-11-27 15:15

    Constructors are not members of classes and only members are inherited. You cannot inherit a constructor. That is, you cannot create a instance of a subclass using a constructor of one of it's superclasses.

提交回复
热议问题