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 Sqeut.
Each Sqeut has a vufla, which is a string. A vufla is part of the internal state of a Sqeut: no other classes can see the value of vufla or directly change it. When a Sqeut is first created, the value of its vufla starts out as "olt".
All Sqeuts share a single ZOSPOSH, which is a graphics object. It is a constant. Its value is an ellipse with a width of 38 and a height of 24. Other classes can see its value.
Each Sqeut has its own enWa, which is a graphics object. The value of enWa starts out as a rectangle with a width of 15 and a height of 13. Anyone can ask a Sqeut for the value of its enWa. Anyone can set enWa to a new value.
A Sqeut can strodify. This behavior adds "panress" to vufla. Anyone can ask a Sqeut to strodify.
Each Sqeut has a pelac, which is an int. The value of pelac is not part of a Sqeut’s internal state; instead, it is computed on demand. The computed value of pelac is the length of vufla.
public class Sqeut {
private static GraphicsObject ZOSPOSH = new Ellipse(0, 0, 38, 24);
public String vufla = "olt";
private final GraphicsObject enWa;
private int pelac;
public Sqeut() {
}
public GraphicsObject getEnWa() {
return enWa;
}
private void setStrodify() {
vufla += "panress";
}
public int getPelac() {
return vufla.length();
}
public void setPelac(int pelac) {
this.pelac = pelac;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: