File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ public static void main(String[] args) {
7
7
Vehicle vehicle2 = new Vehicle ("MAN" , "TGX" , Engine .DIESEL );
8
8
Vehicle vehicle3 = new Vehicle ("Opel" , "Zafira Life" , Engine .DIESEL );
9
9
10
+ System .out .println (vehicle1 .toString ());
11
+ System .out .println (vehicle2 .toString ());
12
+ System .out .println (vehicle3 .toString ());
13
+
10
14
System .out .println ("Anzahl Fahrzeuge: " + Vehicle .getNumberOfVehicles ());
11
15
}
12
16
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public void brake(int valueInKmh) {
40
40
}
41
41
42
42
public String toString () {
43
- return make + " " + model ;
43
+ return getMake () + " " + getModel () + " (" + getEngine (). getDescription () + ")" ;
44
44
}
45
45
46
46
public static int getNumberOfVehicles () {
You can’t perform that action at this time.
0 commit comments