This commit is contained in:
Luca Conte 2023-04-05 15:59:17 +02:00
parent 701c28f43d
commit 111ea888aa
2 changed files with 4 additions and 1 deletions

View File

@ -44,7 +44,7 @@ public class ShoppingCart {
for (CartItem item : items) { for (CartItem item : items) {
sb.append(item); sb.append(item);
} }
sb.append("%nSumme:%55.2f%n".formatted(this.getTotalCost())); sb.append(String.format("%nSumme:%55.2f%n", this.getTotalCost()));
return sb.toString(); return sb.toString();
} }
} }

View File

@ -1,5 +1,8 @@
package com.mymart; package com.mymart;
/**
* Test Klasse für ShoppingCart und CartItem
*/
public class Test { public class Test {
public static void main(String[] args) { public static void main(String[] args) {