I have a question on serialization. If my class has private variables and there are no getters and setters, then how will the value of these variables be read by the Serializat
The default serialization mechanism doesn't care about the access scope of member variables. In other words public, protected, package-private, and private variables are all treated in the same way. The implementation details might vary, but as I remember the Sun JRE does this by implementing much of the serialization in native (JNI) code where access privileges aren't enforced.