java - Serializing a list throwing IO exception -


I need some help .. I am playing it forever and I do not know what I remember And I'm sure it's something small but I can not wrap my head around it. I have a binary search tree in which students are objects, and I am trying to convert paste to a list, then sort the list and when the program goes again, that list Deserialize and add each object back to the tree I am using, I do not know why, but my IOXation is holding on.

This is where I am writing:

  to save private zeros () {JOptionPane.showMessageDialog (blank, "Saving the file ..." ); System.out.println ("Saving record:"); ToListVisitor & LT; Students & gt; ListVisit = New ToListVisitor & lt; & Gt; (); Tree.inOderTraversal (listVisit); System.out.println ("The list includes:" + listVisit.getList ()); Try (object overputstream output = new object overputstream (new file output stream (file)) {output.writeObject (listVisit.getList ()); // Is this line something? } Hold (FileNotFoundException fnfe) {System.out.println ("File not found"); } Hold (IOException ioe) {System.out.println ("An error occurred during serialization"); Println (ioe.getMessage ()); Println (ioe.getStackTrace ()); }} // Save Save Records   

And I am using an toListVisitor by adding an object to a list that appears to be working Because when I line System.out.println ("list contains:" +++ Visit.getList ()); It displays all the content, and then throws this error and nothing is actually serial

The visitor class is here:

  Public class toListVisitor & lt; E comparative & lt; E increases? Super E & gt; & Gt; Applicable visitors & lt; E & gt; {List & lt; E & gt; List = New Arrestist & lt; E & gt; (); Public toListVisitor () {this.list = list; } Public listing & lt; E & gt; GetList () {Return List; } Public Zero Travel (BSTNode & lt; E & gt; node) {System.out.println (node.element); List.add (node.lment); }}   

Can anyone see why I am wrong with this ???

student to serialjob needs to be implemented

Comments

Post a Comment

Popular posts from this blog

jasper reports - How to center align barcode using jasperreports and barcode4j -

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -