⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 collegestudent.java

📁 关于JAVA的代码连接数据库
💻 JAVA
字号:
package GradeManagement.model;
import GradeManagement.util.SystemConstants;

//声明专科类
public class CollegeStudent extends Student {

  public CollegeStudent(){}

  public CollegeStudent(String id, String name, CourseGrade grades[]) {
    super(id, name, grades);
  }

  public CollegeStudent(CollegeStudent student) {
    super(student);
  }

  public float average() {
     return sum() / SystemConstants.COLSCOURSES.length;
   }

  public  int getCourseNumbers() {
    return SystemConstants.COLSCOURSES.length;
  }

  public int compareTo(Object anObject){
    return compareTo((CollegeStudent)anObject);
  }

  //比较成绩大小,当前对象成绩比参数对象成绩大时返回1,相等时返回0,其它返回-1.
  public int compareTo(CollegeStudent anObject){
    if( this == anObject) return 1;
     if(this.sum() > anObject.sum()) return 1;
       else if(this.sum() == anObject.sum()) return 0;
         else return -1;
  } // 方法compareTo结束
} // 类CollegeStudent结束

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -