Using Serialization with a NonSerializable Superclass

Running the Example

Complete the following procedure to compile and run the two examples:

  1. From yourbasedir/objectserializationexamples/NonSerializableSuperClass, compile the files:
      javac NonSerialSuperExample.java
      javac Book.java
      javac ReadingMaterial.java
    
  2. Run the compiled file:
      java NonSerialSuperExample
    

The book object prints out before and after serialization.

blue bar

Additional Information:

Abstract
Sources
List of Examples

Oracle and/or its affiliates Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部