Java – why are constructors not inherited?

I've been using eclipse Juno to learn constructors in inheritance

When I press Ctrl o twice in childclass, it will display the inherited members But I happen to see even superclass constructors in inherited members

But it is said that constructors are not inherited

Can anyone explain this behavior?

Solution

Unlike fields, methods, and nested classes, constructors are not class members

From docs of Inheritance

But why constructor removed from class member??

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>