📄 student.java
字号:
/**
* A class to represent a single student.
* This is a vary simple class with no error checking
* It is intended to be used to demonstrate the use of GUIs
*
* @author Ian Bradley
* @version 10/04/07
*/
public class Student
{
private String name;
private String id;
/**
* Constructor for objects of class Student
*
* @param name student name - not concerned with format
* @param id student id a unique string of digits
*/
public Student(String name, String id)
{
this.name = name;
this.id = id;
}
/**
* getter method for name
*
* @return the student's name
*/
public String getName()
{
return name;
}
/**
* getter method for id
*
* @return the student's id
*/
public String getID()
{
return id;
}
/**
* overrides the toString method
*
* @return a formatted string containing the tudent's name and id
*/
public String toString()
{
return "Student name: " + name + " and ID " + id ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -