Plz correct Code given or tell error

Hi all,

I am trying to find solution but no result.

The code is given below. It compile without any error... but when run it, it gives an error

" Object read error ! Writing aborted; java.io.NotSerializableException Class name

Exception in Thread "main" java.lang.NullPointerException "

import java.io.*;

public class MemberMaintainer

{

public static void main(String[] args) throws IOException, ClassNotFoundException

{

Membership membs = null;

try {

FileInputStream fis = new FileInputStream("Membership.data");

ObjectInputStream ois = new ObjectInputStream(fis);

ClubMember.membershipNumber = ois.readInt();

membs = (Membership)ois.readObject();

ois.close();

}

catch(FileNotFoundException e)

{

membs = new Membership(5);

}

catch(Exception e)

{

System.out.println( "Object read error! " + e.getMessage() );

// System.exit( 1 );

}

I hope i will get reply positively

Regards,

Dave

[1073 byte] By [daveatjavaa] at [2007-10-2 22:11:57]
# 1
This error means the object failed to be written because it was not serializable.
Peter__Lawreya at 2007-7-14 1:28:51 > top of Java-index,Core,Core APIs...
# 2
Thanks for reply dear, I also request you to plz tell me the solution means how to rectify this error.Regards,Dave
daveatjavaa at 2007-7-14 1:28:51 > top of Java-index,Core,Core APIs...
# 3
Make it serializable. Look up java.io.Serializable, or the Serializable specification.
ejpa at 2007-7-14 1:28:51 > top of Java-index,Core,Core APIs...