-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudent.java
executable file
·47 lines (39 loc) · 910 Bytes
/
Student.java
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
/**
* Write a description of class Student here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Student extends Person
{
// instance variables - replace the example below with your own
private int id;
/**
* Constructor for objects of class Student
*/
protected Student() {};
protected Student(String name, int id)
{
// initialise instance variables
this.name = name;
this.id = id;
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
protected void setName(String name) {
this.name = name;
}
protected void setId(int id) {
this.id = id;
}
protected String getName() {
return this.name;
}
protected int getId() {
return this.id;
}
}