1. I think you are confusing StreamTokenizer and StringTokenizer. TT_WORD is only defined for StreamTokenizer. Note that both classes are used in HttpTokenzer.
2. The statement "return this.nextToken();" is a recursive call to HttpTokenizer's nextToken() method. This returns an int, as declared, not a string.
3. Characters in Java support international character sets (and even intergalactical sets such as Klingon ;-). This requires 16 bits, not 8 bits. 16 bits gives you the integer range of 0-65,535 or, in hexadecimal notation, 0x0000-0xffff.
For this assignment, I strongly recommend using the readLine() method, which returns an entire line (as a String) at a time. |