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