Arun raghvan wrote:Both are used to Convert parameter and give it in String Format . So what is the difference
No. Only the String.valueOf method is used to get the String represenation of it's parameter object. The toString method (which all classes have) does not take a parameter.
You can use the String.valueOf method to get the String representation of an object without worrying about null references. If you called toString on a null reference you would get a NullPointerException.
Joined: Aug 22, 2010
Got in Snap !!
subject: Difference between valueOf()Method and toString()Method