-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPassenger.java
More file actions
50 lines (40 loc) · 932 Bytes
/
Copy pathPassenger.java
File metadata and controls
50 lines (40 loc) · 932 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
49
50
public class Passenger{
private long id, credit;
private String name, sit;
private Class classe;
Passenger(String name, long id, long credit){
this.id = id;
this.credit = credit;
this.name = name;
}
long getId(){
return this.id;
}
long getCredit(){
return this.credit;
}
String getName(){
return this.name;
}
String getSit(){
return this.sit;
}
Class getClasse(){
return this.classe;
}
void setClasse( Class classe ){
this.classe = classe;
}
public String toString(){
String class_str;
if(classe instanceof FirstClass){
class_str = " primeira classe";
}else{
class_str = " classe economica";
}
return id + " - " + name + " "+ sit + class_str;
}
void setSit(String sit){
this.sit = sit;
}
}