Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 5 - Parts 1 and 2
Date: Sun Nov 4 2001 11:03 am
Author: Lee, Peter <petel@cmu.edu>
Subject: Re: 3 questions

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.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
3 questions      Chen, Richard      Sun Nov 4 2001 1:24 am       
Re: 3 questions      Chen, Richard      Sun Nov 4 2001 1:30 am       
Re: 3 questions      Chen, Richard      Sun Nov 4 2001 4:02 am       
Re: 3 questions      Lee, Peter      Sun Nov 4 2001 11:05 am       
Re: 3 questions      Lee, Peter      Sun Nov 4 2001 11:07 am       
Re: 3 questions      Lee, Peter      Sun Nov 4 2001 11:04 am       
Re: 3 questions      Lee, Peter      Sun Nov 4 2001 11:03 am       
Re: 3 questions      Chen, Richard      Mon Nov 5 2001 6:43 pm       
Re: 3 questions      Lee, Peter      Mon Nov 5 2001 10:58 pm       

Back to previous screen