parent
8bec667902
commit
ecf14830ce
@ -0,0 +1,74 @@
|
||||
package com.ssm.ioc;
|
||||
|
||||
public class Course {
|
||||
private Integer courseId; // 课程ID
|
||||
private String courseName; // 课程名称
|
||||
private Double credit; // 学分
|
||||
private String teacher; // 教师
|
||||
|
||||
public Integer getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourseId(Integer courseId) {
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public String getCourseName() {
|
||||
return courseName;
|
||||
}
|
||||
|
||||
public void setCourseName(String courseName) {
|
||||
this.courseName = courseName;
|
||||
}
|
||||
|
||||
public Double getCredit() {
|
||||
return credit;
|
||||
}
|
||||
|
||||
public void setCredit(Double credit) {
|
||||
this.credit = credit;
|
||||
}
|
||||
|
||||
public String getTeacher() {
|
||||
return teacher;
|
||||
}
|
||||
|
||||
public void setTeacher(String teacher) {
|
||||
this.teacher = teacher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Course{" +
|
||||
"courseId=" + courseId +
|
||||
", courseName='" + courseName + '\'' +
|
||||
", credit=" + credit +
|
||||
", teacher='" + teacher + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Course(Integer courseId, String courseName, Double credit, String teacher) {
|
||||
this.courseId = courseId;
|
||||
this.courseName = courseName;
|
||||
this.credit = credit;
|
||||
this.teacher = teacher;
|
||||
}
|
||||
|
||||
public Course(String courseName, Double credit, String teacher) {
|
||||
this.courseName = courseName;
|
||||
this.credit = credit;
|
||||
this.teacher = teacher;
|
||||
}
|
||||
|
||||
public Course() {
|
||||
}
|
||||
|
||||
public void printCourseInfo() {
|
||||
System.out.println("========== 课程信息 ==========");
|
||||
System.out.println("课程ID: " + courseId);
|
||||
System.out.println("课程名称: " + courseName);
|
||||
System.out.println("学分: " + credit);
|
||||
System.out.println("授课教师: " + teacher);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue