title: How to convert User-defined class to string
body: <p>I have a class name "Users" and have 2 elements (int)userId and (String)userName.</p>
  
  <pre><code>Users obj1 = new Users(10, "User1");
  </code></pre>
  
  <p>How can I convert the obj1 to string like <strong>"userId: 10, userName: User1"</strong> instead of using </p>
  
  <pre><code>obj1.getUserId(), obj1.getUserName()
  </code></pre>
  
  <p>Is there any function or method that I can change it to string like that? Thanks</p>