getting "Unhandled exception: org.json.JSONException" when running code sample
<p>Help:
I'm using Android Studio and trying to work with a code sample from </p>

<p><a href="https://developer.android.com/reference/org/json/JSONTokener.html" rel="nofollow">https://developer.android.com/reference/org/json/JSONTokener.html</a>
Code sample follows</p>

<pre><code>import org.json.JSONObject;
import org.json.JSONTokener;

String json  = "{"
  + "  \"query\": \"Pizza\", "
  + "  \"locations\": [ 94043, 90210 ] "
  + "}";

  JSONObject object = (JSONObject) new JSONTokener(json).nextValue();
  // TBD - String query = object.getString("query");
  // TBD - JSONArray locations = object.getJSONArray("locations");
</code></pre>

<p>and as I enter these lines, Studio red lines 
  <strong>new JSONTokener(json).nextValue();</strong></p>

<p>The error msg I get when I hover the cursor over the line is
  <em>"Unhandled exception: org.json.JSONException"</em></p>

<p>Any ideas or comments on what is causing this error would be welcome.</p>