Answer to Question #242380 in Java | JSP | JSF for Dave

Question #242380
Program 6 employee rule
1
Expert's answer
2021-09-26T11:43:28-0400
class EmployeeDetails {
    int empid, salary;
    String name;

    public int getEmpid() {
        return empid;
    }

    public void setEmpid(int empid) {
        this.empid = empid;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

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

    @Override
    public String toString() {
        return "Employee [emp_id = " + empid + ", salary = " + salary + ", name = " + "]";
    }
}


public class Employee {
    public static void main(String args[]) {
        EmployeeDetails emp = new EmployeeDetails();
        emp.setEmpid(123);
        emp.setName("Juma");
        emp.setSalary(20000);
        System.out.println(emp);
    }
}  

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS