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 Gohe.
Each Gohe has its own teic, which is an int. The value of teic starts out as 8. Anyone can ask a Gohe for the value of its teic. Anyone can set teic to a new value.
public class Gohe {
private final int teic;
public Gohe() {
}
public int getTeic() {
return teic;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: