ShivlakhanPatel wrote:As already said, you can't serialize that non-serializable object directly. But you can serialize a representation of it. In this case the object in question seems to be completely described by two integers. So write those two integers to the ObjectOutputStream. When you de-serialize, read the two integers and recreate the MathOperation from them.
The main concern behind this post is "HOW CAN WE SERIALIZE THE NON-SERIALIZABE MEMBER OF A CLASS?"
Like in above code "private MathOperation mathOperation = null;" is the reference variable of the class which is non-serializable but which is implemented by some body else and I don;t want to modify that file and want to make this field in my class serializable.
Please help me I m in big time trouble.