    // A simple on/off switch (not attached to anything).
class SimpleSwitch {
        // Turn the switch on.
    public void switchOn(){
        System.out.println("Turn the switch on.");
        setOn(true);
    }

        // Turn the switch off.
    public void switchOff(){
        System.out.println("Turn the switch off.");
        setOn(false);
    }

        // Tell an enquirer whether the switch is on or not.
    public boolean isTheSwitchOn(){
        return getOn();
    }

        // Return the state of the switch.
    private boolean getOn(){
        return on;
    }

        // Set the state of the switch.
    private void setOn(boolean o){
        on = o;
    }

    // Whether the switch is on or not.
    // true means on and false means off.
    private boolean on = false;
}
