StringTokenizer return tokens as Objects - Java Language Basics

Java examples for Language Basics:StringTokenizer

Description

StringTokenizer return tokens as Objects

Demo Code

 
import java.util.StringTokenizer;
 
public class Main {
 
  public static void main(String[] args) {
    StringTokenizer st = new StringTokenizer("Java StringTokenizer Example");
    while(st.hasMoreElements()){
      System.out.println(st.nextElement());
    }   /*from w ww . ja v  a  2 s  .  c om*/
  }
}

Result


Related Tutorials