Absolute Java - Class: Heater

来源:互联网 发布:闲鱼退款淘宝介入 编辑:程序博客网 时间:2024/06/08 11:58

Create a class, Heater, that contains a single integer field, temperature. Define a constructor that takes no parameters. The temperature field should be set to the value 15 in the constructor. Define the mutators warmer and cooler, whose effect is to increase or decrease the value of temperature by 5 degree respectively. Define an accessor method to return the value of temperature.

 

 

原创粉丝点击