mu_xin_g 2022-07-14 17:48 采纳率: 83.3%
浏览 42
已结题

关于#类图#的问题,如何解决?(语言-java)

Maju Enterprise is a new company launched in 2020. The company is in process of hiring new employee to help with their business operation. Once the person is hired, the information will be recorded such as nameientity card, address, assignation and salary. Appropriate employee ID will be assigned to the employee once it is recorded.

Write the encapsulation process by using the class diagram.

img

这个类图对不对.

  • 写回答

1条回答 默认 最新

  • Binary_10010 2022-07-14 17:58
    关注
    
    public class Employee {
        String name;
        String address;
        String assignation;
        int id;
        int salary;
    
        public Employee(String name, String address, String assignation, int id, int salary) {
            this.name = name;
            this.address = address;
            this.assignation = assignation;
            this.id = id;
            this.salary = salary;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public String getAddress() {
            return address;
        }
    
        public String getAssignation() {
            return assignation;
        }
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 7月22日
  • 已采纳回答 7月14日
  • 创建了问题 7月14日