黄舟2017-04-18 10:41:00
No detection at runtime, no difference in memory, you can hack it and call the private method
大家讲道理2017-04-18 10:41:00
Yes, it seems that its various attributes will be verified when loading, and then judged based on these attributes at runtime. I can’t remember the details clearly. .
巴扎黑2017-04-18 10:41:00
In the JVM, the definition of a class and the specific objects of this class are placed in different places. When a line of Java code wants to access a property of an object, the JVM will query which class the object belongs to, whether this class has this property, and if so, whether it can be accessed in the context of the code. The judgment of scope during execution is completely consistent with the judgment of scope during compilation.