• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

toString() Method vs. Casting

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a difference between the 2 following line?
String newString = someObject.toString()
and
String new String = (String)someObject;
Thanks.
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We had a discussion about this a few months ago, check it out here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic