Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is stringtolennizer with example?

Answer Posted / eva

The string tokenizer class allows an application to break a string into tokens

The set of delimiters (the characters that separate tokens) may be specified either at creation time or on a per-token basis.

An instance of StringTokenizer behaves in one of two ways, depending on whether it was created with the returnDelims flag having the value true or false:

If the flag is false, delimiter characters serve to separate tokens. A token is a maximal sequence of consecutive characters that are not delimiters.
If the flag is true, delimiter characters are themselves considered to be tokens. A token is thus either one delimiter character, or a maximal sequence of consecutive characters that are not delimiters.

Example:

StringTokenizer st = new StringTokenizer("this is a test");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}

prints the following output:

this
is
a
test

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps in the jdbc connection?

1014


What is meant by overloading?

1062


What is string literal in java?

1047


What is garbage collection? Can it be forced to run?

1007


what is the purpose of "virtual"?

1081


What is * argv?

1228


can I implement my own start() method? : Java thread

991


What is the difference between ArrayList and Vector? which one is better in Java

1130


What is oop principle in java?

1152


How to check if linked list contains loop in java?

898


How do you identify independent and dependent variables?

1004


What are three ways in which a thread can enter the waiting state in java programming?

1159


Why there is no call by reference in java?

920


What is the largest number a double can hold?

1039


What is the difference between double and float variables in java?

1145