java中的System.out.write和System.out.print有什么区别



我想知道我的Java类中System.out.writeSystem.out.print之间的区别在哪里。

PrintStream的两种方法有不同的含义:

  • print(int)写入整个int的十进制表示,而
  • CCD_ 6将指定的CCD_ 7的最低有效字节写入输出

这会导致不同的结果:如果您调用print(48),输出将是48,但如果您调用write(48),输出将取决于系统,但在大多数系统上,它将是0

演示。

最新更新