JSONArray from JSONArray in java

I need to get JSONArray from JSONArray

      JSONParser parser = new JSONParser();
      JSONObject jObject=(JSONObject)parser.parse(s);
      JSONArray messages = (JSONArray) jObject.get("routes");
      JSONArray ar = (JSONArray)messages.get("legs");

JSONArray.get don’t take string as parameter

my JSON string

    {
   "routes" : [
  {
     "bounds" : {
        "northeast" : {
           "lat" : 27.9786758,
           "lng" : 31.2199858
        },
        "southwest" : {
           "lat" : 27.0120443,
           "lng" : 30.9788969
        }
     },
     "copyrights" : "Map data ©2015 Google, ORION-ME",
     "legs" : [
        {
           "distance" : {
              "text" : "138 km",
              "value" : 138208
           },
           "duration" : {
              "text" : "1 hour 52 mins",
              "value" : 6744
           },

please Help me in this

thank you


Source: json

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.