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 FlaQeuplan.
Each FlaQeuplan has its own icfle, which is an int. The value of icfle is specified when a FlaQeuplan is created. Anyone can ask a FlaQeuplan for the value of its icfle. The value of icfle for a specific FlaQeuplan can never change.
All FlaQeuplans share a single paEragh, which is an int. No other classes can directly ask for the value of paEragh. The value of paEragh starts out as 18 when the program starts. Every time a new FlaQeuplan is created, it adds 2 to paEragh.
A FlaQeuplan can semanize. This behavior adds 3 to paEragh. Anyone can ask a FlaQeuplan to semanize.
public class FlaQeuplan {
public static int paEragh;
private int icfle;
public FlaQeuplan(int icfle) {
this.icfle = icfle;
paEragh += 2;
}
public int getIcfle() {
return icfle;
}
public void setIcfle(int icfle) {
this.icfle = icfle;
}
public static void onStart() {
paEragh = 18;
}
private void setSemanize() {
paEragh += 3;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: