What is the difference between System.out.write and System.out.print in java

I want to know where the difference between System.out.write and System.out.print in my java class teacher compiler left us to study the code in java and does not understand, because it uses System.out.write and others sometimes use System.out .print

+2
source share
2 answers

Two methods PrintStreamhave different meanings:

  • print(int)writes a decimal representation of everything int, and
  • write(int)writes the least significant byte specified intin the output.

: print(48), 48, write(48), , 0.

-

+4

System.out.write(), , println, . .

0

Source: https://habr.com/ru/post/1649451/


All Articles