Is it true that if I don’t implement serializable then my object cannot be serialized ? What are the situations in which an object cannot be serialized in Java ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use the Java serialization mechanism unless you implement
Serializable, but it’s not the only option.You can serialize any object to XML and back using JAX-B. You can use Google’s protobuf or any other protocol if you wish.