Why is the StringTokenizer class in java 1.5 deprecated?? Any obvious reasons. Any better alternative to it?
StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.
The following example illustrates how the String.split method can be used to break up a string into its basic tokens:
String result = "this is a test".split("\\s");
for (int x=0; x<result.length; x++)