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
Explain the difference between jvm and jre?
What is var keyword ?
What is static and final keyword in java?
Why do we need wrapper class?
What is the difference between inheritance and encapsulation?
What is passing by reference in java?
What are some alternatives to inheritance?
Is java owned by oracle?
What is a numeric format?
How do you declare a string variable?
Explain about the security aspect of java?
Why generics are used in java?
When should I use singleton?
Can a variable be local and static at the same time?
Can we extend a class with private constructor?