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