Kotlinlearncs.online LogoJava
Return to List

Solve: Temperature Getters and Setters

Created By: Geoffrey Challen
/ Version: 2020.9.0

Define a class named Temperature with two properties: a Double called temperature and a String called place. Provide a complete constructor that sets both properties with temperature as its first parameter. place should be publicly readable but not writeable, while temperature is both publicly readable and writeable.

Related Lessons

Stuck? You may find these lessons helpful: