https://stackoverflow.com/questions/3295496/what-is-a-javabean-exactly

A JavaBean is just a standard

  1. All properties private (use getters/setters)
  2. A public no-argument constructor
  3. Implements Serializable.

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).

https://stackoverflow.com/questions/1973073/what-is-a-java-bean

[Java123] JavaBean的更多相关文章

  1. java web学习总结(二十九) -------------------JavaBean的两种开发模式

    SUN公司推出JSP技术后,同时也推荐了两种web应用程序的开发模式,一种是JSP+JavaBean模式,一种是Servlet+JSP+JavaBean模式. 一.JSP+JavaBean开发模式 1 ...

  2. java web学习总结(二十八) -------------------JSP中的JavaBean

    一.什么是JavaBean JavaBean是一个遵循特定写法的Java类,它通常具有如下特点: 这个Java类必须具有一个无参的构造函数 属性必须私有化. 私有化的属性必须通过public类型的方法 ...

  3. JavaBean的用法

    JavaBean是一个可重复使用的软件组件,是用Java语言编写的.遵循一定标准的类. JavaBean是Java Web的重要组件,它封装了数据和操作的功能类,供JSP和Servlet调用,完成数据 ...

  4. JSP复习整理(五)JavaBean使用表单处理数据

    一.先建立用户输入的数据 usingGetparameter.html <!DOCTYPE html> <html> <head> <meta charset ...

  5. JSP复习整理(五)JavaBean生命周期

    一.创建一个JavaBean UserBean.java package jsp.test; public class UserBean { private String userName; priv ...

  6. 初识Jsp,JavaBean,Servlet以及一个简单mvc模式的登录界面

    1:JSP JSP的基本语法:指令标识page,include,taglib;page指令标识常用的属性包含Language用来定义要使用的脚本语言:contentType定义JSP字符的编码和页面响 ...

  7. json、javaBean、xml互转的几种工具介绍

    json.javaBean.xml互转的几种工具介绍 转载至:http://blog.csdn.net/sdyy321/article/details/7024236 工作中经常要用到Json.Jav ...

  8. javabean和jsp动作元素

    model1就是利用了jsp和javabean 的组合来处理问题.jsp页面如果有太多的逻辑代码的话,维护起来和扩展起来是相当的麻烦的.所以jsp的逻辑代码部分都打包到一种java类当中进行编写.这种 ...

  9. J2EE基础之JavaBean

    J2EE基础之JavaBean 1.什么是JavaBean? JavaBean本质上来说就是一个Java类,它通过封装属性和方法成为具有独立功能.可重复使用的,并可以与其他控件通信的组件对象.通过在J ...

随机推荐

  1. win10 安装oracle 11gR2_database出现universal Installer后闪退就没反应的解决方案

    前言:本机为 win 10 64位系统,安装oracle win64_11gR2_database的时候出现问题,安装不了,经排查解决了此问题.转载请注明出处:https://www.cnblogs. ...

  2. 您可能不知道的CSS元素隐藏“失效”以其妙用——张鑫旭

    一.CSS元素隐藏 在CSS中,让元素隐藏(指屏幕范围内肉眼不可见)的方法很多,有的占据空间,有的不占据空间:有的可以响应点击,有的不能响应点击.后宫选秀——一个一个看. { display: non ...

  3. jQuery基础(DOM篇,append(),after(),prepend(),insertAfter(),节点删除,遍历方法each())

    1.DOM创建节点及节点属性   创建流程比较简单,大体如下:   - 创建节点(常见的:元素.属性和文本) - 添加节点的一些属性 - 加入到文档中   流程中涉及的一点方法:   - 创建元素:d ...

  4. 转:nginx 官方drupal 配置 - Drupal | NGINX

    #参考:nginx 官方drupal 配置 - Drupal | NGINX server { server_name example.com; root /var/www/drupal8; ## & ...

  5. 转:javascript获取上一访问页面

    原文链接:移动端返回上一页,刚需!document.referrer 详解 全文如下: 返回上一页,在PC端我们可以使用:history.go(-1)或者history.back(),可以正常返回第一 ...

  6. 判断css文件是否加载完成

    function cssReady(fn, link) { var d = document, t = d.createStyleSheet, r = t ? 'rules' : 'cssRules' ...

  7. 基于OpenMP的C++并行编程简单示例

    示例要求:在整数A和B之间找到符合条件的值X,使f(X)=C. 示例代码(需要在VS中开启OpenMP支持): #include<iostream> #include<time.h& ...

  8. maven windows环境nexus3.0私服搭建

    下载 nexus3.x.x 需要JDK1.8版本到sonatype官网下载开源免费的OSS版本,OSS即为Open Source Software.下载地址:https://www.sonatype. ...

  9. 禅道Bug管理工具环境搭建

    下载地址:http://sourceforge.net/projects/zentao/files/8.2/ZenTaoPMS.8.2.stable.exe/download 1.解压ZenTaoPM ...

  10. 使用Spring操作Redis的key-value数据

    前言 最近工作一直忙的不可开交,小Alan已经很久没有和大家分享知识了,在深圳待了两年多,依然感觉自己还是个小菜鸟,工作中还是会遇到很多自己在短期内无法搞定的事情,每当这个时候总是会感觉到很沮丧,就会 ...