Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

void to String

 
pasan gamage
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is method in Calender class call set. This is a void method
using this i set the date but i cann't display it.
how can i convert into a String.
sh-form:how to convert void to String
 
Frank Ying
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The set method in Calender will set values to the calling calendar object. If you need to display the string type of calendar. The toString() method will not produce the results as you want. It just for debugging only. In your case, you can use Date to show the String with the corrent format using SimpleDateFormat.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!