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

what is the difference

 
Andrew Lit
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hallo,
i'd like to know why is there a difference between:
byte[] hallo={75,15,25};
System.out.println(hallo);
System.out.write(hallo);
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The write method puts the bytes from the array directly into the stream, whereas println calls the toString method of the array and puts the bytes representing the resulting String into the stream.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic