source:
http://www.examulator.com/phezam/showquestion.php import java.io.*;
public class Serialize1{
public static void main(
String argv[]) throws IOException{
Serialize1 o = new Serialize1();
o.go();
}
public void go() throws IOException{
String[] obs = {"one","two","three"};
FileOutputStream out = new FileOutputStream("mystrings.ob");
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeObject(obs);
s.flush();
}
}
Answer is : Compilation and output of the serialized content of the obs String array to a new file called mystrings.ob
My Doubt is why it is not raising any exception or giving any error when the class is not implementing Serialize interface?
Thanks,
Geeta Vemula