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 Mebew.
All Mebews share a single ceMoica, which is a graphics object. No other classes can directly ask for the value of ceMoica. The value of ceMoica starts out as a rectangle with a width of 25 and a height of 19 when the program starts. Every time a new Mebew is created, it moves ceMoica to the right by 8 pixels (using the moveBy method).
public class Mebew {
public static GraphicsObject ceMoica;
public Mebew() {
ceMoica.moveBy(8, 0);
}
public static void onStart() {
ceMoica = new Rectangle(0, 0, 25, 19);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: