I'm looking at making an custom Android object Serializable. Should be simple I just cannot find a easy way to do this. I get the fact that I must overload writeObject and readObject... just how do write and read this I don't get. Beginner here ...
public class QObject implements Serializable {
public String lq_a;
public String lq_b;
Vector lq_vec;
private void writeObject(java.io.ObjectOutputStream out) throws IOException{
//should I go one by one a output each element?
out.writeBytes(lq_a);
//or is there a simpler way? Like write this object one liner?
out.writeObject(this);
//should I close the ObjectOutputStream?
out.close();
}
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException{
//baffled here ... how do I read this object?
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)