要求:按照自己的理解,给出问题的定义,然后采用Java语言,给出规范标准的描述,并设计主类完成相关功能的显示
课程的定义与描述
package ch09_07;
public class Course {
private String name;//课程名称
private String teacherName;//授课老师
private String number;//教学班号
public String GetName() {
String a = name;
return a;
}
public String GetTeacherName() {
String b = teacherName;
return b;
}
public String GetNumber() {
String c = number;
return c;
}
public Course(String name,String techerName,String number) {
this.name = name;
this.teacherName = techerName;
this.number = number;
}
public void show() {
System.out.println("课程名称:"+GetName());
System.out.println("授课老师:"+GetTeacherName());
System.out.println("教学班号:"+GetNumber());
}
}
package ch09_07;
public class Test_Course {
public static void main(String[] args) {
Course c1;
c1 = new Course("Java","张继军","001");
c1.show();
}
}