April 2018
Intermediate to advanced
910 pages
33h 21m
English
A JavaBean is a Java class. Like other Java classes, JavaBeans are reusable code. They are unique in their design because they encapsulate several objects into one. There are three conventions a JavaBean class must follow:
Here is an example JavaBean class:
public class MyBean implements java.io.Serializable { // instance variables private int studentId; private String studentName; // no-argument constructor public MyBean() { } // mutator/setter public void setStudentId(int theID) { this.studentId = theID; } // accessor/getter public int getStudentId() { return studentId; } // mutator/setter ...