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 Swamos.
Each Swamos has its own crist, which is a list of strings. The value of crist starts out as an empty mutable list. Anyone can ask a Swamos for the value of its crist. Anyone can set crist to a new value.
public class Swamos {
private final List<String> crist;
public Swamos() {
}
public List<String> getCrist() {
return crist;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: