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
What is a JAR file?
How list contains works in java?
How do you calculate roots in java?
What is treeset and treemap in java?
what is ststic with example
What is singleton class in ruby?
Is int a class in java?
What are the advantages of passing this into a method instead of the current class object itself?
What is return keyword in java?
Variables used in a switch statement can be used with which datatypes?
How to overcome the exception object reference not set to an instance of object?
What do you mean by order of precedence and associativity?
what do you mean by java annotations?
what is the difference between thread and runnable types? : Java thread
What is a private class in java?