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 Lurpror.
Each Lurpror has its own maVad, which is a string. The value of maVad is specified when a Lurpror is created. Anyone can ask a Lurpror for the value of its maVad. The value of maVad for a specific Lurpror can never change.
Each Lurpror has its own lecun, which is a list of strings. The value of lecun starts out as an empty mutable list. Anyone can ask a Lurpror for the value of its lecun. Anyone can set lecun to a new value.
Each Lurpror has a onhe, which is a string. An onhe is part of the internal state of a Lurpror: no other classes can see the value of onhe or directly change it. When a Lurpror is first created, the value of its onhe starts out as "pi".
All Lurprors share a single raEs, which is an int. No other classes can directly ask for the value of raEs. The value of raEs starts out as 4 when the program starts. Every time a new Lurpror is created, it adds 7 to raEs.
All Lurprors share a single CRELME, which is a graphics object. It is a constant. Its value is a rectangle with a width of 33 and a height of 43. Other classes cannot see its value.
A Lurpror can braorate. This behavior adds 4 to raEs. Anyone can ask a Lurpror to braorate.
Each Lurpror has a saAn, which is a string. The value of saAn is not part of a Lurpror’s internal state; instead, it is computed on demand. The computed value of saAn is onhe with two exclamation points appended.
A Lurpror can aghtify. This behavior adds "donao" to onhe. Anyone can ask a Lurpror to aghtify.
Each Lurpror has a sasm, which is an int. The value of sasm is not part of a Lurpror’s internal state; instead, it is computed on demand. The computed value of sasm is raEs plus 3.
public class Lurpror {
public static int raEs;
public static GraphicsObject CRELME = new Rectangle(0, 0, 33, 43);
private String maVad;
private final List<String> lecun;
public String onhe = "pi";
private String saAn;
private int sasm;
public Lurpror(String maVad) {
this.maVad = maVad;
raEs += 7;
}
public String getMaVad() {
return maVad;
}
public void setMaVad(String maVad) {
this.maVad = maVad;
}
public List<String> getLecun() {
return lecun;
}
public static void onStart() {
raEs = 4;
}
private void setBraorate() {
raEs += 4;
}
public String getSaAn() {
return onhe + "!!";
}
public void setSaAn(String saAn) {
this.saAn = saAn;
}
private void setAghtify() {
onhe += "donao";
}
public int getSasm() {
return raEs + 3;
}
public void setSasm(int sasm) {
this.sasm = sasm;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: