Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Heater here.
- *
- * @author Rifqi Mukti W
- * @version 29.09.2017
- */
- public class Heater
- {
- // instance variables - replace the example below with your own
- private double temperature;
- public Heater()
- {
- // initialise instance variables
- temperature = 15.0;
- }
- public void warmer()
- {
- temperature = temperature + 5.0;
- }
- public void cooler()
- {
- temperature = temperature - 5.0;
- }
- public double getTemperature()
- {
- return temperature;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment