How to Generate Setter & Getter using eclipse ide?

 How to Generate Setter & Getter using eclipse ide?

Ans :-

Open eclipse -> Right Click->Source->Generate Getters & Setters -> Select All ->Generate

=> Create Class Employee put some variable there

Example :-

package p3;

public class Employee {
private String name;
private String id;
private double salary;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}

}

**********************************************************************

Open eclipse -> Right Click->Source->Generate Getters & Setters -> Select All ->Generate


Open eclipse -> Right Click->Source->Generate Getters & Setters -> Select All ->Generate


Comments

Popular posts from this blog

What are POJO classes in spring? What is the use of POJO Class, and How to create POJO classes.

How to create React project using command prompt?