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 Pacnee.
Each Pacnee has its own siber, which is a string. The value of siber starts out as "o". Anyone can ask a Pacnee for the value of its siber. Anyone can set siber to a new value.
All Pacnees share a single FEDEAN, which is an int. It is a constant. Its value is 6. Other classes can see its value.
A Pacnee can permolify. This behavior adds "mollteir" to siber. Anyone can ask a Pacnee to permolify.
public class Pacnee {
private final String siber;
private final int FEDEAN = 6;
public Pacnee() {
}
public String getSiber() {
return siber;
}
private void setPermolify() {
siber += "mollteir";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: