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 use of shift operator in java. Can you give some examples?
Why do we use string?
What is a short in java?
What is meant by interface?
What is jee6?
Differentiate between run time error and syntax error.
Does string is thread-safe in java?
Where import statement is used in a java program?
What is thread life cycle?
Can inner class final?
What does || mean in code?
Why are there no global variables in java?
What is meant by oops concept in java?
What are strings in physics?
What is protected access modifier?