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