Loading order and execution results of classes in Java
•
Java
The specific code is as follows:
Execution results:
Static method of parent class 2 static initialization block subclass static initialization block parent class non static initialization block parent class construction method non static initialization block subclass construction method
summary
The above is the loading sequence execution results of classes in Java introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!
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
二维码