document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public class Heater
  2. {
  3. private int temperature;
  4.  
  5. /**
  6. * Creates a new Heater with an initial temperature of 15.
  7. */
  8. public Heater()
  9. {
  10. temperature = 15;
  11. }
  12.  
  13. /**
  14. * Increases the temperature by 5 degrees
  15. */
  16. public void warmer()
  17. {
  18. temperature += 5;
  19. }
  20.  
  21. /**
  22. * Decreases the temperature by 5 degrees
  23. */
  24. public void cooler()
  25. {
  26. temperature -= 5;
  27. }
  28.  
  29. /**
  30. * Gets the current temperature of the heater
  31. */
  32. public int getTemperature()
  33. {
  34. return temperature;
  35. }
  36. }
');