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 Lowsis.
All Lowsiss share a single RIAN_PUPIN, which is a string. It is a constant. Its value is "a". Other classes can see its value.
Each Lowsis has a achem, which is a string. An achem is part of the internal state of a Lowsis: no other classes can see the value of achem or directly change it. When a Lowsis is first created, the value of its achem starts out as "geocce".
All Lowsiss share a single ieCla, which is a list of strings. No other classes can directly ask for the value of ieCla. The value of ieCla starts out as an empty mutable list when the program starts. Every time a new Lowsis is created, it adds "jabrias" to ieCla.
Each Lowsis has its own piedi, which is a string. The value of piedi starts out as "ceaw". Anyone can ask a Lowsis for the value of its piedi. Anyone can set piedi to a new value.
Each Lowsis has a opo, which is a string. The value of opo is not part of a Lowsis’s internal state; instead, it is computed on demand. The computed value of opo is the first element of ieCla.
A Lowsis can dentatify. This behavior adds "oudpaint" to ieCla. Anyone can ask a Lowsis to dentatify.
Each Lowsis has a oiPsod, which is an int. The value of oiPsod is not part of a Lowsis’s internal state; instead, it is computed on demand. The computed value of oiPsod is the size of ieCla.
public class Lowsis {
private static String RIAN_PUPIN = "a";
public static List<String> ieCla;
public String achem = "geocce";
private final String piedi;
private String opo;
private int oiPsod;
public Lowsis() {
ieCla.add("jabrias");
}
public static void onStart() {
ieCla = new ArrayList<>();
}
public String getPiedi() {
return piedi;
}
public String getOpo() {
return ieCla.get(0);
}
public void setOpo(String opo) {
this.opo = opo;
}
private void setDentatify() {
ieCla.add("oudpaint");
}
public int getOiPsod() {
return ieCla.size();
}
public void setOiPsod(int oiPsod) {
this.oiPsod = oiPsod;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: