This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the difference

 
Andrew Lit
Ranch Hand
Posts: 135
  • 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
  • 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