+1 vote
in JAVA by
What is a JavaBean?

1 Answer

0 votes
by
JavaBean is a reusable software component written in the Java programming language, designed to be manipulated visually by a software development environment, like JBuilder or VisualAge for Java. t. A JavaBean encapsulates many objects into one object so that we can access this object from multiple places. Moreover, it provides the easy maintenance. Consider the following example to create a JavaBean class.

//Employee.java  

package mypack;  

public class Employee implements java.io.Serializable{  

private int id;  

private String name;  

public Employee(){}  

public void setId(int id){this.id=id;}  

public int getId(){return id;}  

public void setName(String name){this.name=name;}  

public String getName(){return name;}  

}

Related questions

+2 votes
asked May 12, 2021 in JAVA by rajeshsharma
+1 vote
asked May 12, 2021 in JAVA by rajeshsharma
...