What is Java Bean?
Java bean is a simple java class with instance variables (all private) and each instance variable having getter and setter methods (public) for them.
Example :
class Person { private int id; private String name; private String address; public int getId () { return id; } public String getName () { return name; } public String getAddress () { return address; } public void setId (int id) { this.id = id; } public void setName (String name) { this.name = name; } public void setAddress (String address) { this.address = address; } }
No comments:
Post a Comment