-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
65 lines (56 loc) · 1.33 KB
/
Student.java
File metadata and controls
65 lines (56 loc) · 1.33 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @author Brian Kernighan
*/
public class Student {
private int matric;
private String name;
private String address;
/**
* Query for the matric number of the student.
* @return the matric
*/
public int getMatric ( ) {
return this.matric;
}
/**
* Sets the matric number of the student.
* @param matric the matric number
*/
public void setMatric ( int matric ) {
this.matric = matric;
}
/**
* Query for the name of the student.
* @return the name
*/
public String getName ( ) {
return this.name;
}
/**
* Sets the name of the student.
* @param name the name
*/
public void setName ( String name ) {
this.name = name;
}
/**
* Query for the address of the student.
* @return the address
*/
public String getAddress ( ) {
return this.address;
}
/**
* Sets the address of the student.
* @param address the address
*/
public void setAddress ( String address ) {
this.address = address;
}
/**
* @return a string representation of the Student
*/
public String toString ( ) {
return this.matric + "," + this.name + "," + this.address;
}
}