code: public String getString(int index) throws JSONException {
          Object object = this.get(index);
          if (object instanceof String) {
              return (String) object;
          }
          throw new JSONException("JSONArray[" + index + "] not a string.");
      }
docs: Get the string associated with an index.
  
  @param index
  The index must be between 0 and length() - 1.
  @return A string value.
  @throws JSONException
  If there is no string value for the index.