This is all the input and output after serializing the objects of class T.
Import java.io. *;
Public class TestObjectIO {
Public static void main(String args[]) throws an exception {
T T = new T();
t . k = 8;
file output stream fos = new file output stream(" d:/share/Java/io/testobjectio . dat ");
object output stream OOS = new object output stream(fos);
OOS . writeobject(t);
OOS . flush();
OOS . close();
file inputstream fis = new file inputstream(" d:/share/Java/io/testobjectio . dat ");
ObjectInputStream ois = new ObjectInputStream (FIS);
T tReaded =(T)ois . read object();
system . out . println(treaded . I+" "+treaded . j+" "+treaded . d+" "+treaded . k);
}
}
Class t
Realize serializability
{
int I = 10;
int j = 9;
Double d = 2.3
Transient int k =15;
}