Answer Posted / qim2010
The StreamTokenizer class can tokenizer a Reader into
tokens. For instance, in the string "Mary had a little lamb"
each word is a separate token.
We need to move through the tokens in the underlying Reader
by calling the nextToken() method in a loop. After each
call to nextToken() the StreamTokenizer has several fields
you can read to see what kind of token was read, it's value
etc. These fields are:
ttype The type of token read (word, number, end of line)
sval The string value of the token, if the token was a
string (word)
nval The number value of the token, if the token was a
number.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How to make a class or a bean serializable?
Why strings in java are called as immutable?
What is the collections api in java programming?
What is stringreader?
What is a byte string?
What are the features of java?
What is the size of a string in java?
Define Multiprogramming and Multiprocessing in java.
What restrictions are placed on method overriding?
What does index mean in java?
Explain creating threads by extending thread class ?
Can you override static methods?
How do you sort in java?
Which java version is latest?
How do you do absolute value in java?