java.util.StringTokenizer.hasMoreElements() 方法


java.util.StringTokenizer.hasMoreElements() 方法

package com.codingdict;

import java.util.*;

public class StringTokenizerDemo {
   public static void main(String[] args) {

      // creating string tokenizer
      StringTokenizer st = new StringTokenizer("Come to learn");

      // checking elements
      while (st.hasMoreElements()) {
         System.out.println("Next element : " + st.nextElement());    
      }
   }
}