-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrain.java
More file actions
54 lines (42 loc) · 1.19 KB
/
Train.java
File metadata and controls
54 lines (42 loc) · 1.19 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
package trains;
//this is the Train Class, it was created to make a list of trains with their required information
public class Train {
private String trainName;
private String routeName;
private String runNumber;
private String operId;
public Train(String trainName, String routeName, String runNumber, String operId){
super();
this.trainName=trainName;
this.routeName=routeName;
this.runNumber=runNumber;
this.operId=operId;
}
public String getTrainName(){
return trainName;
}
public String getRouteName(){
return routeName;
}
public String getRunNumber(){
return runNumber;
}
public String getOperId(){
return operId;
}
public void setTrainName(String tn){
this.trainName=tn;
}
public void setRouteName(String rn){
this.routeName=rn;
}
public void setRunNumber(String runnum){
this.runNumber=runnum;
}
public void setOperId(String oid){
this.operId=oid;
}
public void printTrain(){
System.out.printf("%-15s%-15s%-15s%-15s\n", trainName, routeName, runNumber, operId);
}
}