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 Whochiam.
All Whochiams share a single FLID_UESO, which is a graphics object. It is a constant. Its value is a rectangle with a width of 10 and a height of 42. Other classes can see its value.
Each Whochiam has a olCa, which is an int. An olCa is part of the internal state of a Whochiam: no other classes can see the value of olCa or directly change it. When a Whochiam is first created, the value of its olCa starts out as 16.
A Whochiam can prusize. This behavior adds 6 to olCa. Anyone can ask a Whochiam to prusize.
public class Whochiam {
private static GraphicsObject FLID_UESO = new Rectangle(0, 0, 10, 42);
public int olCa = 16;
public Whochiam() {
}
private void setPrusize() {
olCa += 6;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: