First of all, static variables cannot be serialized.
Verification:
- Entity class:
- Serialization:
- Deserialization:
- Result:
- Exception
Deserialization code:
Result:
Reason analysis:
In other words, static variables are stored on the class object. Therefore, after sysRole sets the remark, it will be saved on the class object for subsequent use by SysRole objects.