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 Ciacstar.
All Ciacstars share a single DARDA_MERLIM, which is a graphics object. It is a constant. Its value is a rectangle with a width of 10 and a height of 26. Other classes cannot see its value.
Each Ciacstar has its own fene, which is a string. The value of fene is specified when a Ciacstar is created. Anyone can ask a Ciacstar for the value of its fene. The value of fene for a specific Ciacstar can never change.
Each Ciacstar has a opbre, which is a string. The value of opbre is not part of a Ciacstar’s internal state; instead, it is computed on demand. The computed value of opbre is fene with two exclamation points appended.
public class Ciacstar {
public static GraphicsObject DARDA_MERLIM = new Rectangle(0, 0, 10, 26);
private String fene;
private String opbre;
public Ciacstar(String fene) {
this.fene = fene;
}
public String getFene() {
return fene;
}
public void setFene(String fene) {
this.fene = fene;
}
public String getOpbre() {
return fene + "!!";
}
public void setOpbre(String opbre) {
this.opbre = opbre;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: