String login = "{\"result\":[104192,42068],\"id\":1}";
Object obj = JSONValue.parse(login);
JSONArray array = (JSONArray)obj;
This throw a exception
Exception in thread "main" java.lang.ClassCastException: org.json.simple.JSONObject cannot be cast to org.json.simple.JSONArray
What is the problem in this code ?
In this case the parsed result is a JSONObject
so you need to cast it to that.