File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Difference between Object.toString() and String s= (String)Object
Praveen Kumar KR
Joined: May 08, 2002
Oct 17, 2002 04:09:00
I would like to know what is the diffrrence between using Object.toString() method and type casting like
s = (String)Object.
What should be used when ?
Thanks in advance.
Joined: Jul 13, 2001
Oct 17, 2002 08:09:00
Object toto = new Object();
String s =(String)toto;
An Object is not a String!
Joined: Sep 13, 2002
Oct 17, 2002 09:06:00
There was another thread on this subject last month. Check it out
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
I agree. Here's the link:
subject: Difference between Object.toString() and String s= (String)Object
why new date() prints date ?????
Why Compiler error?.....
Using a char array in string concatenation
assertion expression from K&B
Difference between valueOf()Method and toString()Method
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013