开发者社区> 问答> 正文

数据表与简单Java类(角色与权限)进行单独类的描述代码是什么?

已解决

数据表与简单Java类(角色与权限)进行单独类的描述代码是什么?

展开
收起
JWRRR 2022-04-02 13:15:06 619 0
1 条回答
写回答
取消 提交回答
  • 推荐回答

    Class Dept { // 部门信息

    private int did ;

    private String dname ;

    public Dept(int did,String dname) {

     this.did = did ;
    
     this.dname = dname ;
    

    }

    public String getInfo() {

     return”【部门】did = “+this.did+”,名称=“+this.dname ;
    

    }

    }

    class Emp { // 雇员信息

    private int eid ;

    private String ename ;

    public Emp(int eid,String ename) {

      This.eid = eid ;
    
      This.ename = ename ;
    

    }

    public String getInfo() {

    return “【雇员】eid = “+ this.eid + “、ename=”+this.ename ;

     }
    

    }

    class Role { //角色信息

     private int rid ;
    
     private String title ;
    
     public Role (int rid,String title)  {
    
         this.rid = rid ;
    
         this.title = title ;
    
     }
    
     public Sting getInfo() {
    

    return”【角色】rid = “+this.rid +”、title = “ +this.title ;

     }
    

    }

    class Action { //权限,privilege

    private int aid ;

    private String title ;

    private String flag ;

    public Action (int aid,String title,String flag) {

     this.aid = aid;
    
     this.title = title ;
    
     this.flag = flag ;
    

    }

    Public String getInfo() {

     Return”【权限】aid = “ + this.aid +”、title =”this.title + “+this.flag ;
    

    }

    }

    2022-04-02 13:30:57
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载