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

How to create React project using command prompt?

How to achieve abstraction?

Interview Question? How to find square of each element in this Array {2,4,5,6,8} using map ?