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 Clioess.
Each Clioess has its own nuer, which is a graphics object. The value of nuer is specified when a Clioess is created. Anyone can ask a Clioess for the value of its nuer. The value of nuer for a specific Clioess can never change.
All Clioesss share a single emPeent, which is a list of strings. No other classes can directly ask for the value of emPeent. The value of emPeent starts out as an empty mutable list when the program starts. Every time a new Clioess is created, it adds "ris" to emPeent.
Each Clioess has a olli, which is a string. The value of olli is not part of a Clioess’s internal state; instead, it is computed on demand. The computed value of olli is the first element of emPeent.
public class Clioess {
public static List<String> emPeent;
private GraphicsObject nuer;
private String olli;
public Clioess(GraphicsObject nuer) {
this.nuer = nuer;
emPeent.add("ris");
}
public GraphicsObject getNuer() {
return nuer;
}
public void setNuer(GraphicsObject nuer) {
this.nuer = nuer;
}
public static void onStart() {
emPeent = new ArrayList<>();
}
public String getOlli() {
return emPeent.get(0);
}
public void setOlli(String olli) {
this.olli = olli;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: