How to make a object as Serializable.. For Example i got an object(Where the class didn't serializable) in main Class ... i have to serializable this object..
Just make the class implement the interface Serializable:
Note that the interface doesn't have any methods, so you don't need to implement any methods.
Note: If you cannot modify the class, then it's not going to be possible. You can't make any object serializable. [ June 23, 2008: Message edited by: Jesper Young ]
In theory it is easy; you just add "implements Serializable" after the class name. Serializable is a tagging interface (also called a marker interface) which has no methods.
In practice you need to ensure that all its fields are instances of Serializable classes too.
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one: