GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Technologies
  • Databases
  • Computer Programming
  • Web Development
  • Java Technologies
  • Computer Science
  • Mobile Development
  • Big Data & Analytics
  • Microsoft Technologies
  • DevOps
  • Latest Technologies
  • Machine Learning
  • Digital Marketing
  • Software Quality

This view

  • Original page
  • New address

GeezerVison is showing www.tutorialspoint.com — Java StringTokenizer Class

Java.util package tutorial
  • Java.util - Home
  • Java.util - ArrayDeque
  • Java.util - ArrayList
  • Java.util - Arrays
  • Java.util - BitSet
  • Java.util - Calendar
  • Java.util - Collections
  • Java.util - Currency
  • Java.util - Date
  • Java.util - Dictionary
  • Java.util - EnumMap
  • Java.util - EnumSet
  • Java.util - Formatter
  • Java.util - GregorianCalendar
  • Java.util - HashMap
  • Java.util - HashSet
  • Java.util - Hashtable
  • Java.util - IdentityHashMap
  • Java.util - LinkedHashMap
  • Java.util - LinkedHashSet
  • Java.util - LinkedList
  • Java.util - ListResourceBundle
  • Java.util - Locale
  • Java.util - Observable
  • Java.util - PriorityQueue
  • Java.util - Properties
  • Java.util - PropertyPermission
  • Java.util - PropertyResourceBundle
  • Java.util - Random
  • Java.util - ResourceBundle
  • Java.util - ResourceBundle.Control
  • Java.util - Scanner
  • Java.util - ServiceLoader
  • Java.util - SimpleTimeZone
  • Java.util - Stack
  • Java.util - StringTokenizer
  • Java.util - Timer
  • Java.util - TimerTask
  • Java.util - TimeZone
  • Java.util - TreeMap
  • Java.util - TreeSet
  • Java.util - UUID
  • Java.util - Vector
  • Java.util - WeakHashMap
  • Java.util - Interfaces
  • Java.util - Exceptions
  • Java.util - Enumerations
  • Java.util Useful Resources
  • Java.util - Useful Resources
  • Java.util - Discussion
Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Online Resume Builder
  • HR Interview Questions
  • Computer Glossary
  • Who is Who

Java StringTokenizer Class



Previous
Quiz
Next

Introduction

The Java StringTokenizer class 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.

  • This class methods do not even recognize and skip comments.

Class declaration

Following is the declaration for java.util.StringTokenizer class −

public 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 delim)

This constructor constructs string tokenizer for the specified string.

3

StringTokenizer(String str, String delim, boolean returnDelims)

This constructor constructs a string tokenizer for the specified string.

Class methods

Sr.No. Method & Description
1 int countTokens()

This method calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception.

2 boolean hasMoreElements()

This method returns the same value as the hasMoreTokens method.

3 boolean hasMoreTokens()

This method tests if there are more tokens available from this tokenizer's string.

4 Object nextElement()

This method returns the same value as the nextToken method, except that its declared return value is Object rather than String.

5 String nextToken()

This method returns the next token from this string tokenizer.

Methods inherited

This class inherits methods from the following classes −

  • java.util.Object
Tutorix - AI Tutor
Previous Quiz Next
Advertisements
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.