title: how to parse json object inside json object in java
body: <p>I'm trying to parse below JSON and looking for "zip-code" value "526262". I'm new to Java and struggling to get the zip-code value?</p>
  
  <p>This is my JSON:</p>
  
  <pre><code>{
      "id": "6fffdfdf-8d04-4f4e-b746-20930671bd9c",
      "timestamp": "2017-07-21T03:51:27.329Z",
      "lang": "en",
      "result": {
          "source": "testsrc",
          "resolvedQuery": "testquery",
          "action": "test",
          "actionIncomplete": true,
          "parameters": {
              "zip-code": "526262"
          }
      }
  }
  </code></pre>
  
  <p>And this is my Java code:</p>
  
  <pre><code>       String test= "{\n" +
              "\t\"id\": \"6fffdfdf-8d04-4f4e-b746-20930671bd9c\",\n" +
              "\t\"timestamp\": \"2017-07-21T03:51:27.329Z\",\n" +
              "\t\"lang\": \"en\",\n" +
              "\t\"result\": {\n" +
              "\t\t\"source\": \"testsrc\",\n" +
              "\t\t\"resolvedQuery\": \"testquery\",\n" +
              "\t\t\"action\": \"test\",\n" +
              "\t\t\"actionIncomplete\": true,\n" +
              "\t\t\"parameters\": {\n" +
              "\t\t\t\"zip-code\": \"526262\"\n" +
              "\t\t}\n" +
              "\t}\n" +
              "}";
  
  JSONObject request = new JSONObject(test);
  String zipCode = request.getJSONObject("result").get("parameters").toString();
  System.out.println("zipCode is : " + zipCode);
  </code></pre>
  
  <p>But I'm getting below output:</p>
  
  <pre><code>zipCode is : {"zip-code":"526262"}
  </code></pre>
  
  <p>How to get zip-code value alone?</p>
  
  <p>Can someone help how to get this value in java?</p>