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 Casm.
Each Casm has its own ronek, which is a string. The value of ronek is specified when a Casm is created. Anyone can ask a Casm for the value of its ronek. Anyone can set ronek to a new value.
public class Casm {
private final String ronek;
public Casm(String ronek) {
this.ronek = ronek;
}
public String getRonek() {
return ronek;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: