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
What is a java string?
Explain enumeration in java?
Why do I need to declare the type of a variable in java?
Java.util.regex consists of which classes?
Explain different ways of creating a thread. Which one would you prefer and why?
What is hotjava?
What is the purpose of the runtime class in java programming?
Can private members of a base class are inheritable justify?
What is a string what operation can be performed out with the help of a string?
Can list be null in java?
Why is method overloading not possible by changing the return type in java?
What is a consumer in java?
What does the @override annotation do?
What is the purpose of void?
How to compare two strings in java program?