Level 1 · Apprentice0 XP
A class in one line, properties in place of getters, and object where Java uses static.
Step 1 / 5
ProblemA Java class with three fields needs a constructor that copies three parameters and six accessor methods before it does anything. Static helpers live in a separate Utils class nobody can find.
← → step
Before this: Null safety and data classes
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write a class Temperature with a celsius property that can be read anywhere but changed only through warm(by) and cool(by), a computed fahrenheit property, an init check that rejects values below absolute zero, and a companion factory fromFahrenheit.