-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrarian.java
More file actions
36 lines (28 loc) · 993 Bytes
/
Librarian.java
File metadata and controls
36 lines (28 loc) · 993 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
package LMS;
public class Librarian extends Staff {
int office_id; // Office Number of the Librarian
public static int currOffice_id = 1;
public Librarian(int id, String name, String address, int phone, int dob, double salary, int office_id) // para
// cons.
{
super(id, name, address, phone, dob, salary);
if (office_id == -1) {
this.office_id = currOffice_id;
currOffice_id++;
} else
this.office_id = office_id;
}
public Librarian() {
super();
}
public void printInfo() { // Method override
super.printInfo();
System.out.println("Office Number: " + this.office_id + "\n");
}
public int getOffice() {
return this.office_id;
}
public static int getCurrOffice() {
return currOffice_id;
}
}