ppj/hai/hello/NotEnoughGasException.java
2024-06-13 22:48:56 +02:00

20 lines
394 B
Java

/*
* TASK 9
* archived at https://git.femboy.science/femsci/ppj/src/branch/task/9
* by femsci
*/
package hai.hello;
public class NotEnoughGasException extends Exception {
public NotEnoughGasException(Car c) {
car = c;
}
private final Car car;
@Override
public String getMessage() {
return String.format("not enough gas: %dl left", car.fuel);
}
}