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