Capgemini interview question

implement a code for serialization in java