Practice ยท 1 of 2
A class that counts instances
Inside Solution, write a nested static class Widget with a private final String name, a constructor that stores it, a getter, and a static int count that tracks how many Widgets have been created. Solution.Widget.of("a") style calls are not needed โ the grader creates new Solution.Widget("a") directly and reads Solution.Widget.getCount().
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Practice: Objects at Work