-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
48 lines (42 loc) · 929 Bytes
/
Copy pathStudent.java
File metadata and controls
48 lines (42 loc) · 929 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
47
48
public class Student extends Person
{
private String school;
private int id;
private int level;
public static final int ELEMENTARY = 0;
public static final int MIDDLE = 1;
public static final int HIGH = 2;
public static final int COLLEGE = 3;
public Student(String fname, String lName, String school, int id, int level)
{
super(fname, lName);
this.school = school;
this.id = id;
this.level = level;
}
public String toString()
{
String result = "STUDENT: "+getName()+" "+getBirthday();
result += "\n\t"+this.school+" "+this.id+" ";
switch(this.level){
case 0: result+="ELEMENTARY";
break;
case 1: result+="MIDDLE";
break;
case 2: result+="HIGH";
break;
case 3: result+="COLLEGE";
break;
default:
result+="UNKNOWN";
}
return result;
}
/*
public void greeting()
{
super.greeting();
System.out.println("\tand I am a student at "+school+".");
}
*/
}