About static and non-static resources resources

Static resource is loaded when the class initialization, rather than static objects new resource when it is loaded. We know that the class is initialized earlier than the new target to arrive at the following conclusions.

1. Static methods can not away with non-static resources. Because the non-static resources only appeared after the new, and when static resource loading appeared, just as you can not know what tomorrow's lottery number is much the same, because you appear appearance than the lottery numbers tomorrow morning.

2. Static methods can be called static resources. Because we are all born with the Who who do not know.

3. The non-static method can be called static resources. Because it came out after the non-static method new.

Guess you like

Origin www.cnblogs.com/cxh-/p/12084153.html