Discussion Board
There are no previous messagesGo to the following message
Current Forum: Homework 5 - Parts 1 and 2
Date: Sun Nov 4 2001 1:24 am
Author: Chen, Richard <richardc@andrew.cmu.edu>
Subject: 3 questions

Questions:
1. in HttpTokenizer.java, at the line:
        if (t==StreamTokenizer.TT_WORD)
what is StreamTokenizer.TT_WORD? A private data member of the class StreamTokenizer (which can't be, unless I'm wrong)? A method of the class StreamTokenizer (which can't be, since http://java.sun.com/j2se/1.3/docs/api/java/util/StringTokenizer.html is not missing anything)?

2. in HttpTokenizer.java, at the line:
        return this.nextToken;
The method nextToken in HttpTokenizer says "public int" so how can a "return this.nextToken()" return a String when the method demands it to return an int?

3. For the class Reader (http://java.sun.com/j2se/1.3/docs/api/java/io/Reader.html), the method read() (http://java.sun.com/j2se/1.3/docs/api/java/io/Reader.html#read()) will "Read a single character" but what do we do with that int? Why is that int in the range 0 to 65535 (0x00-0xffff)? What does that range of 0 to 65535 (0x00-0xffff) mean/indicate?

This question applies likewise to the return object of (primitive) type int in HttpTokenizer.java.
Post response

There are no previous messagesGo 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