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 Ciza.
Each Ciza has its own jeFump, which is a list of strings. The value of jeFump is specified when a Ciza is created. Anyone can ask a Ciza for the value of its jeFump. Anyone can set jeFump to a new value.
All Cizas share a single tisi, which is a graphics object. No other classes can directly ask for the value of tisi. The value of tisi starts out as an ellipse with a width of 33 and a height of 31 when the program starts. Every time a new Ciza is created, it moves tisi to the right by 9 pixels (using the moveBy method).
Each Ciza has a weNi, which is an int. The value of weNi is not part of a Ciza’s internal state; instead, it is computed on demand. The computed value of weNi is the width of tisi.
public class Ciza {
public static GraphicsObject tisi;
private final List<String> jeFump;
private int weNi;
public Ciza(List<String> jeFump) {
this.jeFump = jeFump;
tisi.moveBy(9, 0);
}
public List<String> getJeFump() {
return jeFump;
}
public static void onStart() {
tisi = new Ellipse(0, 0, 33, 31);
}
public int getWeNi() {
return tisi.getWidth();
}
public void setWeNi(int weNi) {
this.weNi = weNi;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: