title: User defined Data type to JSON Object type casting using jason.simple
body: <p>I have a user defined data type and I want that to be type casted in JSON Object. The data type is USERS.</p>
  
  <p>I tried to type cast Users into String using <code>.toString()</code> but the output came something different and incorrect. Then I thought of type casting that into JSON Object and then return the result. I want the function to return a data type that can be easily type casted to another. </p>
  
  <p>At first I used this (This - <code>userDao.findOne(k)</code> returns a Users type data):</p>
  
  <pre><code>String u= userDao.findOne(k).toString();
  </code></pre>
  
  <p>The result came as :</p>
  
  <pre><code>com.techprimers.db.model.Users@680b74e5
  </code></pre>
  
  <p>I don't know what is getting wrong there.
  But when I am using return type as Users, the result is:</p>
  
  <pre><code>{
    "id"="Gohan_123",
    "value"=789,
    "Anime"="Dragon Ball Z"
  }
  </code></pre>
  
  <p>I want to convert those Users to JSON Object using JSON.simple but any other packages will also not be a problem.</p>
  
  <p>Thanks in Advance</p>