The readObject() method of ObjectInputStream has a type: it returns Object. Therefore, I find it easy to understand the following example code used in the deserialization:
Cat newCat = (Cat) objectinputstream.readObject();
However, in the task-2015, we used the objectinputstream.defaultReadObject() method, which is void. It returns nothing. It reads the object, the data is already in the stream - but I don't understand the continuation of what more it does. I've been thinking a lot, if this method doesn't return anything, how can I pass the scanned object to the new Thread() constructor? I had to look at the downloaded correct solution, and there I found this:
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
     in.defaultReadObject();
     runner = new Thread(this);
     runner.start();
}
The question arises: how does this work? Perhaps the defaultReadObject() method automatically sets the fields of the current Solution object to the read value? (Perhaps in some hidden way, hidden in the background.) And how can this code be used usefully, e.g. if I want to start the loading of the object from main() ? For example: Solution sol = new Solution.readObject() ? Thank you in advance!:)