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

What do you understand by synchronization?

747


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

731


What restrictions are placed on method overloading?

836


What is the maximum length of a url?

689


what is the volatile modifier for? : Java thread

700






What is externalizable interface?

766


What access modifiers can be used for class ?

723


What is java util concurrentmodificationexception?

668


What is java in detail?

790


Should a main method be compulsorily declared in all java classes?

736


What is not thread safe?

705


2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?

2004


If try block is successfully executed, Then Is Finally block executed?

796


What is the difference between post and put?

729


What is private static in java?

754