- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Methods of StringTokenizer class in Java.
The StringTokenizer class of the java. util package allows an application to break a string into tokens.
- This class is a legacy class that is retained for compatibility reasons although its use is discouraged in new code.
- Its methods do not distinguish among identifiers, numbers, and quoted strings.
- These class methods do not even recognize and skip comments.
Example
import java.util.*; public class Sample { public static void main(String[] args) { // creating string tokenizer StringTokenizer st = new StringTokenizer("Come to learn"); // checking next token System.out.println("Next token is : " + st.nextToken()); } }
Output
Next token is : Come
- Related Articles
- StringTokenizer methods in Java
- StringTokenizer class in Java
- Constructors of StringTokenizer class in Java.
- How can we use the StringTokenizer class in Java?
- Methods of StringBuffer class in Java.
- Methods of StringBuilder class in Java.
- BitSet class methods in Java
- What is the significance of the StringTokenizer class of the Java? Explain with an example?
- Methods of the Matcher class in Java Regex
- Methods of the Pattern class in Java Regex
- Math class methods in Java Programming
- Why static methods of parent class gets hidden in child class in java?
- List methods of a class using Java Reflection
- Static import the Math Class Methods in Java
- What are Class/Static methods in Java?\n

Advertisements