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 Phuonsem.
All Phuonsems share a single phing, which is a string. No other classes can directly ask for the value of phing. The value of phing starts out as "prean" when the program starts. Every time a new Phuonsem is created, it adds "sictcial" to phing.
All Phuonsems share a single ILDI_RONPA, which is a string. It is a constant. Its value is "sticklu". Other classes cannot see its value.
Each Phuonsem has a touk, which is an int. A touk is part of the internal state of a Phuonsem: no other classes can see the value of touk or directly change it. When a Phuonsem is first created, the value of its touk starts out as 5.
Each Phuonsem has a sepe, which is a string. The value of sepe is not part of a Phuonsem’s internal state; instead, it is computed on demand. The computed value of sepe is ILDI_RONPA with two exclamation points appended.
A Phuonsem can odisize. This behavior adds "meaesflih" to phing. Anyone can ask a Phuonsem to odisize.
public class Phuonsem {
public static String phing;
public static String ILDI_RONPA = "sticklu";
public int touk = 5;
private String sepe;
public Phuonsem() {
phing += "sictcial";
}
public static void onStart() {
phing = "prean";
}
public String getSepe() {
return ILDI_RONPA + "!!";
}
public void setSepe(String sepe) {
this.sepe = sepe;
}
private void setOdisize() {
phing += "meaesflih";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: