- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.util.StringTokenizer Class
Introduction
The java.util.StringTokenizer class allows an apppcation to break a string into tokens.
This class is a legacy class that is retained for compatibipty reasons although its use is discouraged in new code.
Its methods do not distinguish among identifiers, numbers, and quoted strings.
This class methods do not even recognize and skip comments.
Class declaration
Following is the declaration for java.util.StringTokenizer class −
pubpc class StringTokenizer extends Object implements Enumeration<Object>
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | StringTokenizer(String str) This constructor a string tokenizer for the specified string. |
2 | StringTokenizer(String str, String depm) This constructor constructs string tokenizer for the specified string. |
3 | StringTokenizer(String str, String depm, boolean returnDepms) This constructor constructs a string tokenizer for the specified string. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method calculates the number of times that this tokenizer s nextToken method can be called before it generates an exception. |
2 | This method returns the same value as the hasMoreTokens method. |
3 | This method tests if there are more tokens available from this tokenizer s string. |
4 | This method returns the same value as the nextToken method, except that its declared return value is Object rather than String. |
5 | This method returns the next token from this string tokenizer. |
6 | This method returns the next token in this string tokenizer s string. |
Methods inherited
This class inherits methods from the following classes −
java.util.Object