StringTokenizer st = new StringTokenizer("Hello World of Java"); while (st.hasMoreTokens()) System.out.println("Token: " + st.nextToken());