Explain Stream Tokenizer?

Answer Posted / srinu

Stream Tokenizer from java.util package this class
implements Enumeration interface.This class break the string
into tokens with take parameter as delimeter

EX:-
import java.util.*;
public class Strtok
{

public static void main(String [] args)
{

String Demo = "This is a string that we want to tokenize";
StringTokenizer Tok = new StringTokenizer(Demo);
int n=0;
while (Tok.hasMoreElements())
System.out.println("" + ++n +": "+Tok.nextElement());
}
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by a JVM?

846


Can inner class extend any class?

824


What is difference between overloading and overriding in java?

765


When will we prefer to use set and list in java and why?

730


What is the r character?

816


What is null object in java?

804


1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?

4419


What is an exception in java?

896


What is natural ordering in java?

750


What are user defined exceptions?

810


Can we serialize static variables in java?

881


What is a parameter used for?

747


What is the purpose of garbage collection in java?

862


Explain about assignment statement?

828


What is string value?

855