Serializing private variables in Java
•
Java
I have a problem If my class has private variables without getters and setters, the serialization API will read the values of these variables
Solution
Serialization APIs don't have to worry about private variables The purpose is to convert your objects to binary representations in files, or other types of storage that will be rebuilt later
Here is an explanation of Java's serialization algorithm
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
二维码