1 package coffee; 2 3 class ElectricHeater implements Heater { 4 boolean heating; 5 on()6 @Override public void on() { 7 System.out.println("~ ~ ~ heating ~ ~ ~"); 8 this.heating = true; 9 } 10 off()11 @Override public void off() { 12 this.heating = false; 13 } 14 isHot()15 @Override public boolean isHot() { 16 return heating; 17 } 18 } 19