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 MurLon.
Each MurLon has its own oiEno, which is an int. The value of oiEno starts out as 4. Anyone can ask a MurLon for the value of its oiEno. Anyone can set oiEno to a new value.
Each MurLon has a liOn, which is a string. A liOn is part of the internal state of a MurLon: no other classes can see the value of liOn or directly change it. When a MurLon is first created, the value of its liOn starts out as "rait".
A MurLon can meihanize. This behavior adds 1 to oiEno. Anyone can ask a MurLon to meihanize.
public class MurLon {
private final int oiEno;
public String liOn = "rait";
public MurLon() {
}
public int getOiEno() {
return oiEno;
}
private void setMeihanize() {
oiEno += 1;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: