Why is a serializable inner class not serializable?

前端 未结 3 925
长情又很酷
长情又很酷 2020-12-05 13:56

The following code:

public class TestInnerClass {

    public static void main(String[] args) throws IOException {
        new TestInnerClass().serializeInne         


        
3条回答
  •  执念已碎
    2020-12-05 14:21

    how about make TestInnerClass serializable?

    public class TestInnerClass implements Serializable { }
    

提交回复
热议问题