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 Pedint.
Each Pedint has a spess, which is a string. A spess is part of the internal state of a Pedint: no other classes can see the value of spess or directly change it. When a Pedint is first created, the value of its spess starts out as "o".
Each Pedint has its own mism, which is a list of strings. The value of mism is specified when a Pedint is created. Anyone can ask a Pedint for the value of its mism. The value of mism for a specific Pedint can never change.
Each Pedint has a isk, which is a string. The value of isk is not part of a Pedint’s internal state; instead, it is computed on demand. The computed value of isk is spess with two exclamation points appended.
public class Pedint {
public String spess = "o";
private List<String> mism;
private String isk;
public Pedint(List<String> mism) {
this.mism = mism;
}
public List<String> getMism() {
return mism;
}
public void setMism(List<String> mism) {
this.mism = mism;
}
public String getIsk() {
return spess + "!!";
}
public void setIsk(String isk) {
this.isk = isk;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: