📄 student.java~28~
字号:
package generalSort;
/**
* <p>Title:Student </p>
*
* <p>Description: A simple class to describ a student, which has three properties and four methods
*
****Property ID represents the student-number of a student
****Property Name represents the name of a student
****Property flag specify the way to sort students, that's , sorting by its ID or its Name
****Method int getID() returns the student-number of a student
****Method String getName() returns the name of a student
****Method int getFlag() returns the value of property flag
****Method String toString() returns the description of a student with properties ID & Name
*
* </p>
* <p>Copyright: Copyright (c) 2008 All rights reserved</p>
* <p>Company:Shandong University </p>
* @Email:ruohanxiao@yahoo.com.cn
* @author: Xiao Ruohan
* @version 1.0
*/
public class Student {
private String Name;
private int ID;
private int flag = 1;
public Student() {
}
public Student(int id, String name) {
this.ID = id;
this.Name = name;
}
public Student(int id, String name, int flag) {
this.ID = id;
this.Name = name;
if (flag != 1) {
this.flag = 2;
}
}
public int getFlag() {
return this.flag;
}
public int getID() {
return this.ID;
}
public String getName() {
return this.Name;
}
public String toString() {
return ("The current student's ID & Name is "+this.ID+" "+this.Name);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -