org.json.simple.JSONObject cannot be cast to org.json.JSONObject

前端 未结 2 513
天命终不由人
天命终不由人 2020-12-11 02:24

When I run the following code...

  JSONObject jsonObject = null;
  JSONParser parser=new JSONParser(); // this needs the \"json-simple\" library

  try 
  {
         


        
2条回答
  •  臣服心动
    2020-12-11 03:11

    You have imported the wrong class. Change

    import org.json.JSONObject;
    

    to

    import org.json.simple.JSONObject;
    

提交回复
热议问题