There is an error message at every verification:
"The server is unable to properly test your solution. Be sure you have all the classes you need. Be sure that your solution doesn't have any infinite loops."
I guess it's because of List<Person>:
public static class Person implements Externalizable {
...
private List<Person> children;
public void writeExternal(ObjectOutput out) throws IOException {
....
out.writeObject(children);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
....
//children = (List)in.readObject();
children = (List<Person>) in.readObject();
}
My Question is: What is the correct way to writExternal / readExternal a filled List ?
Thanks for helping.
How to serialize and deserialize a list with Externalizable?
In der Diskussion
Kommentare (1)
- Beliebt
- Neu
- Alt
Du musst angemeldet sein, um einen Kommentar schreiben zu können
Thomas
17 Juni 2020, 16:11
I did it that way (as you already had it):
0