selectcourse.java

来自「哈工大实验课源代码」· Java 代码 · 共 32 行

JAVA
32
字号
package mystudent;
public class SelectCourse {
	private int studentId;//学号(studentId)课程名(courseName)所得分数(score)
	private String courseName;
	private double score;
	public SelectCourse(int studentId, String courseName, int score) {//构造方法
		
		this.studentId = studentId;
		this.courseName = courseName;
		this.score = score;
	}
	public String getCourseName() {//读取课程名
		return courseName;
	}
	
	public int getScore() {//读取所得分数
		return score;
	}
	public void setScore(int score) {//设置所得分数
		this.score = score;
	}
	public int getStudentId() {//读取学生学号
		return studentId;
	}
	public void print()//输出各个属性的值
	{
		System.out.println("学号:" + getStudentId() + " 课程名:"
		+ getCourseName() + " 成绩:" + getScore());
	}
	
}

⌨️ 快捷键说明

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