Class declarations and object modeling: Correct Solution


Translate the specification below into an idiomatic Java class definition.

(In this context, "idiomatic" means following the common style and conventions of the language.)

  1. One kind of thing that exists in our model is a Chliaftmi.

  2. All Chliaftmis share a single TES_NODAN, which is an int. It is a constant. Its value is 16. Other classes can see its value.

Solution

public class Chliaftmi {
    private final int TES_NODAN = 16;

    public Chliaftmi() {
    }
}

Things to check in your solution:

Acceptable variations in the solution:


Related puzzles: