-
Notifications
You must be signed in to change notification settings - Fork 1
/
Car.java
69 lines (46 loc) · 1.22 KB
/
Car.java
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
66
67
68
69
import java.io.Serializable;
public class Car implements Serializable {
private String Name, Colour;
String RegNo;
private int RentPerHour=50;
public Car() {
}
public Car( String Name, String Colour, String RegNo) {
this.Name = Name;
this.Colour = Colour;
this.RegNo = RegNo;
}
public String getName() {
return Name;
}
public void setName(String Name) {
this.Name = Name;
}
public String getColour() {
return Colour;
}
public void setColour(String Colour) {
this.Colour = Colour;
}
public String getRegNo() {
return RegNo;
}
public void setRegNo(String RegNo) {
this.RegNo = RegNo;
}
public int getRentPerHour() {
return RentPerHour;
}
public void setRentPerHour(int RentPerHour) {
this.RentPerHour = RentPerHour;
}
@Override
public String toString() {
return
"Name = " + getName() + "\n" +
"Colour = " + getColour() + "\n"+
"RegNo = " + getRegNo() + "\n"+
"Rent per Hour= " + getRentPerHour() + "\n"
;
}
}