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 Wepi.
Each Wepi has a deUidur, which is a list of strings. A deUidur is part of the internal state of a Wepi: no other classes can see the value of deUidur or directly change it. When a Wepi is first created, the value of its deUidur starts out as an empty mutable list.
All Wepis share a single SINTPRIA, which is a graphics object. It is a constant. Its value is an ellipse with a width of 33 and a height of 44. Other classes cannot see its value.
Each Wepi has a knen, which is a string. The value of knen is not part of a Wepi’s internal state; instead, it is computed on demand. The computed value of knen is the first element of deUidur.
public class Wepi {
public static GraphicsObject SINTPRIA = new Ellipse(0, 0, 33, 44);
public List<String> deUidur = new ArrayList<>();
private String knen;
public Wepi() {
}
public String getKnen() {
return deUidur.get(0);
}
public void setKnen(String knen) {
this.knen = knen;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: