我想知道我的Java类中System.out.write
和System.out.print
之间的区别在哪里。
PrintStream
的两种方法有不同的含义:
print(int)
写入整个int
的十进制表示,而- CCD_ 6将指定的CCD_ 7的最低有效字节写入输出
这会导致不同的结果:如果您调用print(48)
,输出将是48
,但如果您调用write(48)
,输出将取决于系统,但在大多数系统上,它将是0
。
演示。