title: Convert Calendar to String
body: <p>I want to convert Calendar output to String. The following is my code</p>
  
  <pre><code>Calendar cal=Calendar.getInstance();
  System.out.println("Time is "+cal.getTime());
  String str=cal.getTime();   //This is how I want to store the output, but this is wrong.
  </code></pre>
  
  <p>Here the output of the getTime() method is of 'Date' type, so getting error.
  Is there any way to typecast or any solution?</p>