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 Herphoal.
Each Herphoal has its own pisi, which is a list of strings. The value of pisi is specified when a Herphoal is created. Anyone can ask a Herphoal for the value of its pisi. The value of pisi for a specific Herphoal can never change.
public class Herphoal {
private List<String> pisi;
public Herphoal(List<String> pisi) {
this.pisi = pisi;
}
public List<String> getPisi() {
return pisi;
}
public void setPisi(List<String> pisi) {
this.pisi = pisi;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: