title: Java OBJECT to JSONObject
body: <p>What I am trying to do is create a <code>toJSONObject()</code> method which returns the JSONObject that has some data from the object as a JSONObject!</p>
  
  <p>Here is the method I'd really like to call, </p>
  
  <pre><code>public JSONObject(java.lang.Object object, java.lang.String[] names)
  </code></pre>
  
  <p>Where:</p>
  
  <p><code>object</code> - An object that has fields that should be used to make a JSONObject.<br>
  <code>names</code> - An array of strings, the names of the fields to be obtained from the object.</p>
  
  <p>However, eclipse isn't admitting that this specific constructor call is valid, though there's <a href="http://www.json.org/javadoc/org/json/JSONObject.html" rel="nofollow">online documentation</a> for it. </p>
  
  <p>How can I get this to work for me?</p>