Java inheritance problem

Suppose I extend a class and override the methods in that class What is wrong with calling rewriting from my new class constructor?

Solution

The main reason for not calling overridable methods from constructors is that it allows subclasses to view classes in a semi - constructed state This may or may not be a security risk, but it is a waiting error Read more here

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
分享
二维码
< <上一篇
下一篇>>