You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
text1/src/domain/CDC.java

81 lines
1.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package domain; // 定义在 domain 包下,表示该类是领域对象类,用于存储学院、系、班级等信息。
/**
* CDC类表示学院、系、班级信息。
* 该类用于表示和操作学院、系及班级的相关信息。
*/
public class CDC {
private String college; // 学院名称
private String department; // 系名称
private String cclass; // 班级名称
/**
* 获取学院名称。
*
* @return 返回学院名称
*/
public String getCollege() {
return college;
}
/**
* 设置学院名称。
*
* @param college 学院名称
*/
public void setCollege(String college) {
this.college = college;
}
/**
* 获取系名称。
*
* @return 返回系名称
*/
public String getDepartment() {
return department;
}
/**
* 设置系名称。
*
* @param department 系名称
*/
public void setDepartment(String department) {
this.department = department;
}
/**
* 获取班级名称。
*
* @return 返回班级名称
*/
public String getCclass() {
return cclass;
}
/**
* 设置班级名称。
*
* @param cclass 班级名称
*/
public void setCclass(String cclass) {
this.cclass = cclass;
}
/**
* 重写 toString 方法,返回学院、系、班级信息的字符串表示。
*
* @return 返回一个包含学院、系、班级信息的字符串
*/
@Override
public String toString() {
return "CDC{" +
"college='" + college + '\'' +
", department='" + department + '\'' +
", cclass='" + cclass + '\'' +
'}';
}
}