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 This is where I am writing: And I am using an The visitor class is here: Can anyone see why I am wrong with this ??? 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.
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
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
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); }}
student to
serialjob needs to be implemented
जावा प्रोग्रामिंग नमूना कोड स्निपेट
ReplyDeleteकैनवस (टैब कैप्चरिंग कैनवस) नमूना कोड