`
gteam.yu
  • 浏览: 26972 次
  • 性别: Icon_minigender_1
  • 来自: 成都
最近访客 更多访客>>
社区版块
存档分类
最新评论

Java 源代码 随手记录 一 java.io.Serializable

    博客分类:
  • Java
阅读更多
这个只是一个Java源代码的部分记录,免得有时候想去看了,还要打开编译器。

Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this
interface will not have any of their state serialized or deserialized.  All subtypes of a serializable class are themselves serializable.  The serialization interface has no methods or fields and serves only to identify the semantics of being serializable.

If a serializable class does not explicitly declare a serialVersionUID, then the serialization runtime will calculate a default serialVersionUID value for that class based on various aspects of the class, as described in the Java(TM) Object Serialization Specification.  However, it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected InvalidClassException during deserialization.  Therefore, to guarantee a consistent serialVersionUID value across different java compiler implementations, a serializable class must declare an explicit serialVersionUID value.  It is also strongly advised that explicit serialVersionUID declarations use the private modifier where possible, since such declarations apply only to the immediately declaring class--serialVersionUID fields are not useful as inherited members. Array classes cannot declare an explicit serialVersionUID, so they always have the default computed value, but the requirement for matching serialVersionUID values is waived for array classes.
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    java.io.Serializable序列化问题

    java.io.Serializable序列化问题

    Java远程控制源代码

    Java远程控制源代码 学习用的 package steady; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.Serializable; public...

    stuts2.2_API文档

    java.lang.Throwable (implements java.io.Serializable) java.lang.Exception java.lang.RuntimeException com.opensymphony.xwork2.XWorkException (implements com.opensymphony.xwork2.util.location.Locatable...

    java 中序列化NotSerializableException问题解决办法

    主要介绍了java 中序列化NotSerializableException问题解决办法的相关资料,这里对序列化问题进行描述说明,并提供解决办法,希望能帮助到大家,需要的朋友可以参考下

    aesjava源码-THIS-.-IS-GREAT-:////IntelliJIDEA从.class文件重新创建的源代码//(由Fernflo

    导入java.io.Serializable; 导入java.security.AccessController; 导入java.security.AuthProvider; 导入java.security.InvalidParameterException; 导入java.security.Key; 导入java.security....

    java中的IO操作总结(四)

    import java.io.Serializable; @SuppressWarnings("serial") //一个类要想实现序列化则必须实现Serializable接口 class Person implements Serializable { private String name; private int age; public ...

    java->serializable深入了解

    java->serializable深入了解 java->serializable深入了解 java->serializable深入了解

    spring4.0 API

    java.util.HashMap,V> (implements java.lang.Cloneable, java.util.Map,V>, java.io.Serializable) java.util.LinkedHashMap,V> (implements java.util.Map,V>) org.springframework.core.annotation....

    JAVA核心知识点整理(有效)

    25 JAVA8 与元数据.................................................................................................................................25 2.4. 垃圾回收与算法 .................................

    http依赖jar包.zip

    import java.io.Serializable; import java.util.HashMap; import java.util.Map; import com.google.gson.JsonObject; import com.google.gson.JsonArray; import net.sf.json.JSONObject; import org.apache....

    基于JAVA的学籍管理系统

    public class Student implements java.io.Serializable { String number,name,discipling,grade,borth,sex; public Student() { } public void setNumber(String number) { this.number=number; } public ...

    Java程序设计复习题.docx.docx

    在Java程序中import语句可以有多个 在Java程序中import语句可以没有 在Java程序中import语句必须有一个 在Java程序中import语句引入在所有类定义之前 在编译Java程序时,用于指定生成.class文件位置的选项是 B 。...

    Java 面试宝典

    1、一个".java"源文件中是否可以包括多个类(不是内部类)?有什么限制? ...... 7 2、Java 有没有 goto? .......................................................................................................

    java对象序列化Demo------------Serializable

    java 序列化 对象 Serializable 写着玩的Demo 简单 实用

    Java IO.pdf

    Java IO 一、概览 Java 的 I/O 大概可以分成以下几类: 磁盘操作:File 字节操作:InputStream 和 OutputStream 字符操作:Reader 和 Writer 对象操作:Serializable 网络操作:Socket 新的输入/输出:NIO

    Java_Serializable(序列化)的理解和总结

    Java_Serializable(序列化) 的理解和总结

    Java+SQL学籍管理系统

    其中一共包含6个页面,分别是: Delete.java Inquest.java ... /** * * @author Administrator */ public class Student implements java.io.Serializable { String number,name,discipling,grade,borth,sex;

Global site tag (gtag.js) - Google Analytics