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 an IspDovin.
All IspDovins share a single SEPEFREL, which is a string. It is a constant. Its value is "rost". Other classes cannot see its value.
Each IspDovin has its own ulIoss, which is a string. The value of ulIoss starts out as "albed". Anyone can ask an IspDovin for the value of its ulIoss. Anyone can set ulIoss to a new value.
Each IspDovin has a giTesm, which is a string. The value of giTesm is not part of an IspDovin’s internal state; instead, it is computed on demand. The computed value of giTesm is ulIoss with two exclamation points appended.
public class IspDovin {
public static String SE_PE_FREL = "rost";
private final String ulIoss;
private String giTesm;
public IspDovin() {
}
public String getUlIoss() {
return ulIoss;
}
public String getGiTesm() {
return ulIoss + "!!";
}
public void setGiTesm(String giTesm) {
this.giTesm = giTesm;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: