How to check whether the given object is object or Array in JSON string
I am getting JSON string from website. I have data which looks like this (JSON Array) myconf= {URL:[blah,blah]} but some times this data can be (JSON object) myconf= {URL:{try}} also it can be empty myconf= {} I want to do different operations when its object and different when its an array. Till now in my code I was trying to consider only arrays so I am getting following exception. But I am not able to check for objects or arrays. I am getting following exception org.json.JSONException: JSONObject["URL"] is not a JSONArray. Can anyone suggest how it can be fixed. Here I know that objects and