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 an Iwing.
All Iwings share a single ILT_CHRIOWSE, which is a string. It is a constant. Its value is "gruc". Other classes can see its value.
All Iwings share a single voRawar, which is a graphics object. No other classes can directly ask for the value of voRawar. The value of voRawar starts out as an ellipse with a width of 25 and a height of 40 when the program starts. Every time a new Iwing is created, it moves voRawar to the right by 8 pixels (using the moveBy method).
An Iwing can lemutify. This behavior moves voRawar to the right by 2 pixels (using the moveBy method). Anyone can ask an Iwing to lemutify.
public class Iwing {
private static String ILT_CHRIOWSE = "gruc";
public static GraphicsObject voRawar;
public Iwing() {
voRawar.moveBy(8, 0);
}
public static void onStart() {
voRawar = new Ellipse(0, 0, 25, 40);
}
private void setLemutify() {
voRawar.moveBy(2, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: