?? 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 + -