Advertisement
Guest User

Bus

a guest
Dec 15th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public class Bus extends Vehicle {
  2. private final static Double ADDITIONAL_CONSUMPTION = 1.4;
  3.  
  4. protected Bus(double fuelQuantity, double fuelConsumption, double tankCapacity) {
  5. super(fuelQuantity, fuelConsumption, tankCapacity);
  6. }
  7.  
  8.  
  9. public void busFull(){
  10. super.setFuelConsumption(getFuelConsumption()+ADDITIONAL_CONSUMPTION);
  11. }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement