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 Blooar.
Each Blooar has its own jePimia, which is an int. The value of jePimia is specified when a Blooar is created. Anyone can ask a Blooar for the value of its jePimia. The value of jePimia for a specific Blooar can never change.
All Blooars share a single atal, which is a string. No other classes can directly ask for the value of atal. The value of atal starts out as "doldel" when the program starts. Every time a new Blooar is created, it adds "psa" to atal.
All Blooars share a single USS_TEESS, which is a string. It is a constant. Its value is "pengous". Other classes can see its value.
Each Blooar has its own cupna, which is a string. The value of cupna is specified when a Blooar is created. Anyone can ask a Blooar for the value of its cupna. Anyone can set cupna to a new value.
Each Blooar has a chaen, which is a string. The value of chaen is not part of a Blooar’s internal state; instead, it is computed on demand. The computed value of chaen is USS_TEESS with two exclamation points appended.
A Blooar can assanify. This behavior adds "tasspud" to cupna. Anyone can ask a Blooar to assanify.
Each Blooar has a vuHi, which is an int. The value of vuHi is not part of a Blooar’s internal state; instead, it is computed on demand. The computed value of vuHi is jePimia squared.
public class Blooar {
public static String atal;
private static String USS_TEESS = "pengous";
private int jePimia;
private final String cupna;
private String chaen;
private int vuHi;
public Blooar(int jePimia, String cupna) {
this.jePimia = jePimia;
atal += "psa";
this.cupna = cupna;
}
public int getJePimia() {
return jePimia;
}
public void setJePimia(int jePimia) {
this.jePimia = jePimia;
}
public static void onStart() {
atal = "doldel";
}
public String getCupna() {
return cupna;
}
public String getChaen() {
return USS_TEESS + "!!";
}
public void setChaen(String chaen) {
this.chaen = chaen;
}
private void setAssanify() {
cupna += "tasspud";
}
public int getVuHi() {
return jePimia * jePimia;
}
public void setVuHi(int vuHi) {
this.vuHi = vuHi;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: