Code example for ObjectStreamField

0
    } 
 
    private static class WithUnmatchingSerialPersistentFields implements 
            java.io.Serializable {
        private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
                "value", String.class) };
 
        public int anInstanceVar = 5;
 
        public WithUnmatchingSerialPersistentFields() { 
            super(); 
        } 
    } 
 
    private static class WithMatchingSerialPersistentFields implements 
            java.io.Serializable {
        private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
                "anInstanceVar", String.class) };
 
        public String anInstanceVar = FOO + FOO;