serialization - An error: java.io.NotSerializableException -


i have class define follow

public class evaluationresult implements java.io.serializable {     public string classname;     public boolean feedbackdirected;     public double hv;     public double spread;     public double percentageofcorrectness;     public double timeelapsed;     public arraylist<double[]> paretofront;   } 

doing this

public static void main(string[] args) throws exception {          evaluationresult ae=new evaluationresult();          fileoutputstream fileout =new fileoutputstream("result.txt");          objectoutputstream out = new objectoutputstream(fileout);          out.writeobject(fileout);          out.close();          fileout.close();      } 

gives me java.io.notserializableexception problem?

you must implement serializable in class definition:

public class evaluationresult implements serializable {     public string classname;     public boolean feedbackdirected;     public double hv;     public double spread;     public double percentageofcorrectness;     public double timeelapsed;     public arraylist<double[]> paretofront;  } 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -