21-07-2022 - Programming Grooming
21-07-2022 - Programming Grooming
21-07-2022 - Programming Grooming
Serializable;
}
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.Scanner;
import java.util.TreeSet;
}catch (Exception e)
{
System.out.println(e);
}
finally {
try {
fout.close();
out.close();
}catch (Exception e) {
System.out.println(e);
}
}
}
}
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.Iterator;
import java.util.TreeSet;
Object obj=in.readObject();
TreeSet<Employee> ts=(TreeSet<Employee>)obj;
Iterator<Employee> itr=ts.iterator();
while(itr.hasNext())
{
System.out.println(itr.next());
}
}
}