public class LightV2 {
    private static int numberOfLights; // static member
    private boolean on; // member
    private final int serialNumber; // blanck final member
    // The blank final is a final variable whose declaration lacks initializer.
    public static final boolean ON = true; // constant
    public static final boolean OFF = false; // constant
    public LightV2() {
        // blank finals have to be initializated in the constructor
        serialNumber = numberOfLights;
        numberOfLights++;
    }
    public boolean isOn() { // method (boolean getter)
        return (on == ON);
    }
    public void setOn(boolean on) { // method (setter)
        this.on = on;
    }
    public int getSerialNumber() { // method (getter)
        return serialNumber;
    }
    public static int getNumberOfLights() { // static method (getter)
        // No tiene this y por tanto solo puede acceder a atributos static.
        return numberOfLights;
    }
    // toString() autogenerado
    // Explicar insercion de codigo
    // (constructor, getter, setter, toString, property)
    @Override
    public String toString() {
        return "LightV2{" + "on=" + on + ", serialNumber=" + serialNumber + '}';
    }
}
