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