Q:

Why printing '\0' will nullify the rest of the line in Java?

I find out to my puzzlement that the following snippet:
void print() {
    System.out.print("!");
    System.out.print("!\0");
    System.out.flush(); // This line does not affect the outcome
    System.out.println("!");
    System.out.println("!");
}

Will only print out:
!!
!

I searched the Open JDK's source code for the implementation, but no avail.
The only clue have the clue that it seems BufferedOutputStream, and it seem to also have the similar "terminate on \u0000" behavior.
Also I cannot find any documentation about this pretty unexpected (for me) behavior.
EDIT: My environment:
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

IDE: Eclipse Indigo 3.7.0

EDIT AGAIN: Under command line, this code works as expected (four "!"s). So it seems to be a bug for Eclipse 3.7.0 Indigo under Ubuntu?
(Should be) FINAL EDIT: It seems that as irreputable and amir75 said, this is not a quirk of Java: I redirected the output of Eclipse to a file, and if I open it up in Eclipse, the content only have three "!"s; but when using cat from the command line, there are four. In addition, vi and emacs both show !!^@! for the first line, which is as expected. Thank you all!
Could anybody shed some light on this? Is this required anywhere in Java Spec? Thanks for any inputs!

A:

This is terminal-dependent: I just tried in Eclipse, and it reproduced your error. On commandline, it didn't.
I think this can be expected, because most languages since C use \0 ( a null byte) internally to signify the end of a String. 
Thanks to the late, great Dennis Ritchie, that's how stuff works.

