博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
blog.java123_[Java123] JavaBean
阅读量:5106 次
发布时间:2019-06-13

本文共 1126 字,大约阅读时间需要 3 分钟。

A JavaBean is just a standard

That's it. It's just a convention. Lots of libraries depend on it though.

With respect to Serializable, from the API documentation:

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.

In other words, serializable objects can be written to streams, and hence files, object databases, anything really.

Also, there is no syntactic difference between a JavaBean and another class -- a class is a JavaBean if it follows the standards.

There is a term for it because the standard allows libraries to programmatically do things with class instances you define in a predefined way. For example, if a library wants to stream any object you pass into it, it knows it can because your object is serializable (assuming the lib requires your objects be proper JavaBeans).

转载地址:http://mqudv.baihongyu.com/

你可能感兴趣的文章
weblogic设置数据库自动重连
查看>>
[数据结构][LINUX内核编程]学习笔记(二)
查看>>
Spring AOP 理论
查看>>
Java EE、Java SE和Java ME
查看>>
为什么要使用MQ消息中间件?它解决了什么问题?
查看>>
二手书网页版mis系统
查看>>
Oracle_高级功能(9) 性能优化
查看>>
OpenGL入门程序二:绘制简单的圆
查看>>
计算线段和圆的交点
查看>>
extjs中修改confirm的显示按钮
查看>>
linux2.4.0源码下载地址(配合毛德操情景分析)
查看>>
vnc Unable to licence server: "XML error 0:0 Error: First Tag not found"问题的解决
查看>>
java项目移植出现的错误
查看>>
vs2015 编译时错误列表中没有错误,dll却没有生成出来
查看>>
使用mybatis调用存储过程(注解形式和配置文件形式)
查看>>
ASP中预编件aspx安装netframewo
查看>>
[物理学与PDEs]第1章习题参考解答
查看>>
麦克劳林
查看>>
Unity3D游戏开发初探—2.初步了解3D模型基础
查看>>
(二) Go的关键字
查看>>