1、根据类图,用源代码定义类的变量和方法名
package com.demo; /** * @date 2021/12/2 15:49 * 抽象用户类 */ public interface User { Task task = null; //任务获取 public static void use_taskAdd(){} } package com.demo; /** * @date 2021/12/2 15:51 * 外包人员类 */ public class WorkPerson implements User{ private String w_id; //外包人员编号 private String w_num; //外包人员登录名 private String w_pwd; //外包人员密码 private String w_contract; //外包人员在做外包项目 //登录 public boolean work_Login(){ return true; } //信息登记 public String work_Add(){ return ""; } //识别验证 public boolean work_Recognize() { return true; } //合同签订 public String work_Contract(){ return ""; } //接收外包任务 public void use_taskAdd(){ } } package com.demo; /** * @date 2021/12/2 15:53 * 发包人员类 */ public class SendPerson implements User{ private String s_id; //发包人员编号 private String s_num; //发包人员登录名 private String s_pwd; //发包人员密码 //制定实施计划 public boolean send_setPlan(){ return true; } //指定外包人员 public boolean send_setWorkPerson(){ return true; } //发布外包任务 public void use_taskAdd(){ } //追踪任务状态 public boolean send_getTaskState(){ return true; } } package com.demo; /** * @author June * @date 2021/12/2 15:50 */ public abstract class Task { private String t_id; private String t_state; private String t_plan; } package com.demo; /** * @author June * @date 2021/12/2 16:15 */ public class ConcreteTask extends Task{ private String t_id; //任务编号 private String t_state; //任务状态 private String t_plan; //任务计划 private String t_workPerson; //任务指定人员 public String getT_state() { return t_state; } public void setT_state(String t_state) { this.t_state = t_state; } public String getT_workPerson() { return t_workPerson; } }
2、类图