-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathStudent.java
More file actions
47 lines (42 loc) · 1009 Bytes
/
Student.java
File metadata and controls
47 lines (42 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* A class representing students for a simple BlueJ demo program.
*
* @author Michael Kölling
* @version 1.0, January 1999
*/
class Student extends Person
{
private String SID; // student ID number
/**
* Create a student with default settings for detail information.
*/
public Student()
{
super("(unknown name)", 0000);
SID = "(unknown ID)";
}
/**
* Create a student with given name, year of birth and student ID
*/
public Student(String name, int yearOfBirth, String studentID)
{
super(name, yearOfBirth);
SID = studentID;
}
/**
* Return the stident ID of this student.
*/
public String getStudentID()
{
return SID;
}
/**
* Return a string representation of this object.
*/
public String toString() // redefined from "Person"
{
return super.toString() +
"Student\n" +
"Student ID: " + SID + "\n";
}
}