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 do you mean by object?
What is the escape character in java?
What is collection sort in java?
What are the main differences between the java platform and other platforms?
What is final keyword in java?
What is an enumeration?
Explain the use of javap tool.
How to print an arraylist in java?
What is the difference between serial and throughput garbage collector?
Is linked list a linear or non-linear data structure?
Which number is denoted by leading 0x or 0x in java?
What is currentthread()?
What is the type of lambda expression?
Can arraylist hold different types java?
What is the difference between an interface and an abstract class?