title: Get string from JSON like PHP in Java
body: <p>I was wondering if there is a way to get a string from JSON in Java like there is in PHP:</p>
  
  <pre><code>&lt;?php
  $json = @file_get_contents('example');
  
  $decoded_json = json_decode($json);
  echo $decoded_json-&gt;{"something"} ;
  ?&gt;
  </code></pre>
  
  <p>I have currently tried:</p>
  
  <pre><code>String input = "[{"minecraft.net":"green"},{"session.minecraft.net":"green"},{"account.mojang.com":"green"},{"auth.mojang.com":"green"},{"skins.minecraft.net":"green"},{"authserver.mojang.com":"green"},{"sessionserver.mojang.com":"green"},{"api.mojang.com":"green"},{"textures.minecraft.net":"green"}]";
  String wanted = "minecraft.net";
  JSONObject json = new JSONObject(input);
  String out = json.getString(wanted);
  System.out.println(out);
  </code></pre>
  
  <p>However, it gives me this error:</p>
  
  <pre><code>org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
  </code></pre>
  
  <p>Thanks!</p>