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

📄 lesson.java

📁 学生成绩处理GUI界面,Java初学者可参考学习
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package studentscore;import java.io.Serializable;/** * * 课程类 * @author Conupe Fox */public class Lesson  implements Serializable {    private String name;                  //课程名称    private long id;                       //课程编号    private float points;                  //学分    private int hours;                   //学时    private float score;                   //分数    /** 构造方法 */    public Lesson(long id, String name, float points, int hours){        setName(name);        setPoints(points);        setHours(hours);        setId(id);    }    public Lesson(){        this(0l, "Default Lesson", 0, 0);    }    public Lesson(Lesson l){        this(l.getId(),l.getName(), l.getPoints(), l.getHours());    }    /** Getter & Setter*/    public String getName(){        return name;    }    public float getPoints(){        return points;    }    public int getHours(){        return hours;    }    public long getId(){        return id;    }    public float getScore(){        return score;    }    public void setName(String name){        this.name = name;    }    public void setPoints(float points){        this.points = points;    }    public void setHours(int hours){        this.hours = hours;    }    public void setScore(float score){        this.score = score;    }    public void setId(long id){        this.id = id;    }    @Override    public String toString(){        return this.getId() + " " + this.getName();    }    public boolean equals(Lesson l){        if(this.getId() == l.getId())            return true;        else            return false;    }    @Override    public Lesson clone(){        Lesson ls = new Lesson(this.getId(), this.getName(), this.getPoints(), this.getHours());        ls.setScore(this.getScore());        return ls;    }}

⌨️ 快捷键说明

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