1:00 pm - Wednesday February 22, 2017

Program for creating stringtokenizer using String nexttokens() method

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

BACK

Program for creating stringtokenizer using String nexttokens()  method

Example Program

import java.util.StringTokenizer;

public class StringTokenizernexttoken {

	public static void main(String[] args) {

		// creating stringtokenizer

		StringTokenizer st = new StringTokenizer("Hello world");

		// checking next token

		System.out.println("Next token is :" + st.nextToken());

	}

}

 

Output

Next token is :Hello

 

Explanation

public String nextToken()

Returns the next token from this string tokenizer.

Returns:

the next token from this string tokenizer.

Throws:

NoSuchElementException – if there are no more tokens in this tokenizer’s string.

BACK

Filed in: Z-A All Java Codes

Comments are closed.