A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
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
assertion expression from K&B
Difference between valueOf()Method and toString()Method
Using a char array in string concatenation
why new date() prints date ?????
Why Compiler error?.....
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015