Translate the specification below into an idiomatic Java class definition.
(In this context, "idiomatic" means following the common style and conventions of the language.)
One kind of thing that exists in our model is a SnaPrid.
All SnaPrids share a single PHARME, which is a list of strings. It is a constant. Its value is ["ismeth", "on"]. Other classes can see its value.
public class SnaPrid {
private static List<String> PHARME = List.of("ismeth", "on");
public SnaPrid() {
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: