Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        // with delimeter
        StringTokenizer st = new StringTokenizer("tutorial/from/java2s.com");

        // checking next token
        System.out.println("Next token is : " + st.nextToken("/"));
        System.out.println("Next token is : " + st.nextToken("/"));
        System.out.println("Next token is : " + st.nextToken("/"));
    }
}