JavaBeans: Difference between revisions

Content deleted Content added
Fleizach (talk | contribs)
Dmuth (talk | contribs)
JavaBean Example: Fixed datatype on getAge(), added no-argument constructor
Line 20:
private String name;
private int age;<BR>
public void PersonBean() {
// Our constructor. Note that it takes no arguments.
}<BR>
public void setName(String n) {
this.name = n;
Line 26 ⟶ 29:
this.age = a;
}<BR>
public String getName() { return (this.name); }
public Stringint getAge() { return (this.age); }
}