This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

println(String x) unnecessary ?

 
Timothy Toe
Ranch Hand
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is fine that the println method of PrintStream is overloaded for each primitive types and also the Object reference. But why do we need another overloaded println method for String when we already have one for Object ? I understand that String is an Object in Java.
Doesn’t
void println(Object x)
make
void println(String x)
unnecessary ?
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a call x.toString() in println(Object x) that is not needed in println(String x)
A little speed gain, or for completeness?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic