Kotlinlearncs.online LogoJava
Return to List

Solve: Temperature Getters and Setters

Created By: Geoffrey Challen
/ Version: 2020.9.0

Define a public class named Temperature with two instance variables: a double called temperature and a String called place. Provide a complete constructor that sets both fields with temperature as its first parameter. Provide a getter and setter for temperature, and only a getter for place. Your getters and setters should follow our naming convention: get or set followed by the name of the field, capitalized.

Related Lessons

Stuck? You may find these lessons helpful: