question archive CAN SOMEONE REWORD THIS JAVA CODE without changing any classes package application; public class Employee { private int eid; private String name; private String department; private float salary; private String mobileNo; public Employee() { super(); } public Employee(int eid, String name, String department, float salary, String mobileNo) { super(); this
Subject:Computer SciencePrice:9.82 Bought3
CAN SOMEONE REWORD THIS JAVA CODE without changing any classes package application; public class Employee { private int eid; private String name; private String department; private float salary; private String mobileNo; public Employee() { super(); } public Employee(int eid, String name, String department, float salary, String mobileNo) { super(); this.eid = eid; this.name = name; this.department = department; this.salary = salary; this.mobileNo = mobileNo; } public int getEid() { return eid; } public void setEid(int eid) { this.eid = eid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public float getSalary() { return salary; } public void setSalary(float salary) { this.salary = salary; } public String getMobileNo() { return mobileNo; } public void setMobileNo(String mobileNo) { this.mobileNo = mobileNo; } }
package application;
public class Employee
{
private int emp_id;
private String emp_fulname;
private String emp_dept;
private float emp_income;
private String phoneNumber;
public Employee()
{
super();
}
public Employee(int emp_id, String emp_fulname, String emp_dept, float emp_income, String phoneNumber)
{
super();
this.emp_id = emp_id;
this.emp_fulname = emp_fulname;
this.emp_dept = emp_deptmnt;
this.emp_income = emp_income;
this.phoneNumber = phoneNumber;
}
public int getEmp_id()
{
return emp_id;
}
public void setEmp_id(int emp_id)
{
this.emp_id = emp_id;
}
public String getEmp_fulname()
{
return emp_fulname;
}
public void setEmp_fulname(String emp_fulname)
{
this.emp_fulname = emp_fulname;
}
public String getEmp_dept()
{
return emp_dept;
}
public void setEmp_dept(String emp_dept)
{
this.emp_dept = emp_dept;
}
public float getEmp_income()
{
return emp_income;
}
public void setEmp_income(float emp_income)
{
this.emp_income = emp_income;
}
public String getPhoneNumber()
{
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber)
{
this.phoneNumber = phoneNumber;
}
}
Step-by-step explanation
Above is the edited code. I have renamed the integer, the strings and the float names. However, i have made sure that the meaning is maintained.
As you instructed on the question, I have ensured that the class Employee remained the same as well as the package name