title: The constructor JSONObject(String) is undefined error - not able to resolve
body: <p>I am trying to get some variables in servlet which are all passed through ajax call. But i am getting constructor JSONobject(string) is undefined error. I have imported required lib also. Please help</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import com.google.gson.Gson;
  import com.google.gson.JsonArray;
  import com.google.gson.JsonElement;
  import com.google.gson.reflect.TypeToken;
  
  import org.json.simple.JSONArray;
  import org.json.simple.JSONObject;
  import org.json.simple.parser.JSONParser;
  import org.json.simple.parser.ParseException;
  import org.json.*;
  
  
  public class insertserv extends HttpServlet {
   private static final long serialVersionUID = 1L;
   
   
   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
   {    
    
    System.out.println("I am inside insert");
       String json = "";
    
    
    BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
      
  
               if (br != null) {
                   json = br.readLine();
               }
    
      System.out.println(json);
      
      JSONObject wholedata= new JSONObject(json);
    
      
      response.setContentType("application/json"); 
    PrintWriter out= response.getWriter();
    
   }
  }</code></pre>
  </div>
  </div>
  </p>