Question from the Java test

What interface should a class implement to be serializable?

Hard

The following class implements an Interface

import java.io.IOException
import java.io.ObjectInputStream
import java.net.Socket

public class MyClass implements InterfaceToFind {
    private String name = null;
    private transient Socket sock = null;
    private void readObject(ObjectInputStream inputStream) throws IOException,
ClassNotFoundException {
        System.out.println("readObject called");
        inputStream.defaultReadObject();
    }
}

What should it be ?

Author: Thomas De verdièreStatus: PublishedQuestion passed 2904 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!