Home > Java > javaTutorial > body text

What is javaBean

青灯夜游
Release: 2019-05-23 18:14:58
Original
6667 people have browsed it

What is javaBean

JavaBean is a reusable component (software model) written in JAVA language. It is a special Java class that has a certain function or processes a certain function by encapsulating properties and methods. Business objects (beans).

Characteristics of javabean

Since javabean is based on java language, javabean does not depend on the platform and has the following characteristics:

1. Code reuse can be achieved

2. Easy to write, easy to maintain, easy to use

3. It can be used on any platform with a Java runtime environment installed without recompiling.

JavaBeans can be divided into two types:

1. JavaBeans with user interface (UI, User Interface);

2. Without user interface , a JavaBean that is mainly responsible for processing transactions (such as data operations and database manipulation). JSP usually accesses this kind of JavaBean.

Requirements for JavaBean

● Properties must be private (private String username)

● Private properties must provide get or set methods

● Must provide an empty constructor (manually provide a constructor with parameters, then the empty constructor must be provided manually)

● Implement the Serializable interface (optional)

Recommended related video tutorials: "JAVA Tutorial"

The above is the detailed content of What is javaBean. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template