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 Plorta.
Each Plorta has a ste, which is a string. A ste is part of the internal state of a Plorta: no other classes can see the value of ste or directly change it. When a Plorta is first created, the value of its ste starts out as "e".
Each Plorta has its own noOlti, which is an int. The value of noOlti is specified when a Plorta is created. Anyone can ask a Plorta for the value of its noOlti. The value of noOlti for a specific Plorta can never change.
A Plorta can liompify. This behavior adds "crecblarp" to ste. Anyone can ask a Plorta to liompify.
public class Plorta {
public String ste = "e";
private int noOlti;
public Plorta(int noOlti) {
this.noOlti = noOlti;
}
public int getNoOlti() {
return noOlti;
}
public void setNoOlti(int noOlti) {
this.noOlti = noOlti;
}
private void setLiompify() {
ste += "crecblarp";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: