Practice · 2 of 3
A validated record
CHALLENGE
Difficulty: beginner+25 XP
Inside Solution, write record Weather(String city, double celsius) with a compact constructor that rejects null/blank city and celsius below -273.15 (IllegalArgumentException). Add static double average(Weather[] readings) returning the mean celsius of a non-empty array.
Press Submit to check your solution.
Back to lesson: Practice: Practice: Modeling Data