0
import java.io.*;
public class Test {
public static void main(String[] args) throws IOException {
try (ObjectOutputStream output =
new ObjectOutputStream(new FileOutputStream("object.dat"));) {
output.writeObject(new A());
}
}
}
class A implements Serializable {
B b = new B();
}
class B {
}
为什么会在下面的代码中发生javaNotSerializableException?请尽量简单化,因为我的prorammming功能不如我喜欢的那么好。NotSerializableException:意外