Volatile final: final field: its content cannot be changed, and it must be initialized when it is declared. final class: cannot be inherited. String class in java.lang packages is a example of final class final
What are transient and volatile modifiers? When serializable interface is declared, the compiler knows that the object has to be handled so as to be able to serialize it. However, if you declare a variable in an object as transient, then it doesn’t get serialized.VolatileSpecifying a ...
checkAccess(caller, clazz, obj, modifiers); } } MethodAccessor ma = methodAccessor; // read volatile if (ma == null) { ma = acquireMethodAccessor(); } return ma.invoke(obj, args); } 很明显了,就是在反射调用HashSet的writeObject方法,同理反序列化也就是在反射调用HashSet中的readObjcet方法...