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 VidHeb.
All VidHebs share a single IEW_DI, which is a string. It is a constant. Its value is "ruils". Other classes cannot see its value.
Each VidHeb has its own astid, which is a graphics object. The value of astid starts out as an ellipse with a width of 46 and a height of 21. Anyone can ask a VidHeb for the value of its astid. Anyone can set astid to a new value.
A VidHeb can ossify. This behavior moves astid to the right by 1 pixels (using the moveBy method). Anyone can ask a VidHeb to ossify.
public class VidHeb {
public static String IEW_DI = "ruils";
private final GraphicsObject astid;
public VidHeb() {
}
public GraphicsObject getAstid() {
return astid;
}
private void setOssify() {
astid.moveBy(1, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: