Explain Stream Tokenizer?

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


Please Help Members By Posting Answers For Below Questions

Mention some features of java?

543


List down the methods and interfaces of collection class in java.

549


What language is pass by reference?

574


What are different types of inner classes ?

563


Have you ever used hashtable and dictionary?

581






Explain what access modifiers can be used for variables?

593


Can a boolean be null java?

545


What are the three parts of a lambda expression?

538


What are parameters in a method?

587


Is array serializable java?

525


What is a modifier?

877


What is a parameter in java?

548


what is the purpose of the runtime class?

555


Explain the difference between private, public, package and protected in java?

600


Why arraylist is used in java?

553