code: public JSONArray put(int index, boolean value) throws JSONException {
      put(index, value ? Boolean.TRUE : Boolean.FALSE);
      return this;
    }
docs: Put or replace a boolean value in the JSONArray. If the index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out.
  
  @param index
  The subscript.
  @param value
  A boolean value.
  @return this.
  @throws JSONException
  If the index is negative.