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

Can we pass a primitive type by reference in java? How

525


What is a jagged array in java?

530


What are the types of casting?

592


How is Object Oriented Programming different from Procedure Oriented Programming?

587


Can we sort hashmap in java?

524






What are default methods ?

572


How many characters is 16 bytes?

531


What best practices should you follow while writing multithreaded code in java?

539


Is empty list java?

518


What does bitwise or mean?

563


whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net

1657


Difference between comparator and comparable in java?

612


What do you mean by compiler?

578


What will be the output of round(3.7) and ceil(3.7)?

673


What are the ways in which a thread can enter the waiting state?

510