package com.zzu.ti;
public class User {
private int type = 1;
/**
* 1 学生 2 教师 3 管理员 默认为学生
*/
private String typeName;
/**
* 用户唯一标示, 学号 ,工号,或者其他,也是用户名
*/
private String id;
private String password;
private String name;
private String teacherSubject;
public User() {
}
public String getTeacherSubject() {
return teacherSubject;
}
public void setTeacherSubject(String teacherSubject) {
this.teacherSubject = teacherSubject;
}
@Override
public String toString() {
return "User{" +
"type=" + type +
", typeName='" + typeName + '\'' +
", id='" + id + '\'' +
", password='" + password + '\'' +
", name='" + name + '\'' +
", teacherSubject='" + teacherSubject + '\'' +
'}';
}
@Override
public int hashCode() {
return id.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id)) {
return false;
}
return true;
}
public User(int type, String id, String password, String name) {
super();
this.type = type;
this.id = id;
this.password = password;
this.name = name;
setTypeName();
}
public User(int type, String id, String password, String name,
String teacherSubject) {
super();
this.type = type;
this.id = id;
this.password = password;
this.name = name;
this.teacherSubject = teacherSubject;
setTypeName();
}
private void setTypeName() {
if (this.getType() == 1) {
this.typeName = "学生";
}
if (this.getType() == 2) {
this.typeName = "老师";
}
if (this.getType() == 3) {
this.typeName = "管理员";
}
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Java作业管理系统
共19个文件
class:8个
java:8个
prefs:1个
4星 · 超过85%的资源 需积分: 45 167 下载量 48 浏览量
2018-11-04
13:44:24
上传
评论 35
收藏 21KB RAR 举报
温馨提示
Java作业管理系统 ,学生上传作业,教师批改作业,管理员管理教师和学生,作业的增删改查,
资源推荐
资源详情
资源评论
收起资源包目录
zzu.rar (19个子文件)
bin
com
zzu
ti
Homework.class 4KB
User.class 3KB
Container.class 4KB
TeacherView.class 3KB
Main.class 2KB
ManagerView.class 3KB
SUtil.class 5KB
StudentView.class 3KB
.settings
org.eclipse.jdt.core.prefs 642B
src
com
zzu
zzu
User.java 3KB
SUtil.java 3KB
ManagerView.java 3KB
StudentView.java 3KB
Homework.java 3KB
Container.java 2KB
TeacherView.java 3KB
Main.java 1KB
.project 377B
.classpath 396B
共 19 条
- 1
资源评论
- 九某2019-05-20挺不错的,适合初学参考学习
- 天空蓝宝石蓝2019-04-08还好,适合初学者看一下
qq_39196735
- 粉丝: 4
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功