4 ms·
You could use Java records to make things more concise: record Truck(int loadCapacity) implements Vehicle {} record Car(int numberOfSeats, String brandName
by weksf54 1y ago
You could use Java records to make things more concise:
record Truck(int loadCapacity) implements Vehicle {}
record Car(int numberOfSeats, String brandName) implements Vehicle {}
sealed interface Vehicle permits Car, Truck {}