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 Froc.
Each Froc has its own itUdod, which is a graphics object. The value of itUdod is specified when a Froc is created. Anyone can ask a Froc for the value of its itUdod. The value of itUdod for a specific Froc can never change.
public class Froc {
private GraphicsObject itUdod;
public Froc(GraphicsObject itUdod) {
this.itUdod = itUdod;
}
public GraphicsObject getItUdod() {
return itUdod;
}
public void setItUdod(GraphicsObject itUdod) {
this.itUdod = itUdod;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: