Note: The argument to the Java interpreter is the name of the class, not the name of a file.
- UNIX
% java Count This is test. ^D Input has 16 chars.- DOS shell (Windows 95/NT)
C:\> java Count This is test. ^Z Input has 17 chars.Note: the program gives different results for UNIX and DOS systems. On UNIX when you press the return key, you get a single character:
\n
. However, on DOS when you press the return key, you get two characters:\r\n
.