In this section, you will learn to convert an object to a string. Object is a class of java.lang package.
This program helps you in converting an object type data into a string type data. The toString() method returns a string representation of the object. So, we get the an object type data is 10 and this program converts into a string type data as a '10'.
Here is the code of this program:
Output of this program given below.
String value is:=10
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: July 5, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles