Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


neelam
Java stringtokenizer
1 Answer(s)      4 years and 2 months ago
Posted in : Java Interview Questions


What is difference between string and stringtokenizer?

Advertisement
View Answers

October 18, 2010 at 6:00 PM


Hi,

The string tokenizer class allows an application to break a string into tokens.The StringTokenizer methods do not distinguish among identifiers, numbers, and quoted strings, nor do they recognize and skip comments.

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.

Thanks.



Related Tutorials/Questions & Answers:
Java stringtokenizer
Java stringtokenizer  What is difference between string and stringtokenizer
Problems in Stringtokenizer
node[]; StringTokenizer str,str1; Input() throws Exception { FileReader df=new FileReader("Input.txt"); Scanner fr=new Scanner(df); str=new StringTokenizer... StringTokenizer(fr.nextLine(),"$"); System.out.println("rtryutrty"+n+vn); for(int i
Advertisements
Problems in Stringtokenizer
node[]; StringTokenizer str,str1; Input() throws Exception { FileReader df=new FileReader("Input.txt"); Scanner fr=new Scanner(df); str=new StringTokenizer... StringTokenizer(fr.nextLine(),"$"); System.out.println("rtryutrty"+n+vn); for(int i
Problems in Stringtokenizer
node[]; StringTokenizer str,str1; Input() throws Exception { FileReader df=new FileReader("Input.txt"); Scanner fr=new Scanner(df); str=new StringTokenizer... StringTokenizer(fr.nextLine(),"$"); System.out.println("rtryutrty"+n+vn); for(int i
Query on StringTokenizer
Query on StringTokenizer   Sir,I kept my some data in backend using ms-access. for Example my data is like this vijayawada is good city.india is my country.i am raja. when i retrieve this data from backend and keep
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code  hi, I have done a program whereby it can read a Java file and then tokenize them into tokens. However, I am facing
program using StringTokenizer
program using StringTokenizer  I want to know about StringTokenizer,so can you please explain it with an example
Can iadd StringTokenizer into JLabel componenet
Can iadd StringTokenizer into JLabel componenet  l24="india.cricket.java.dotnet.oracle" String mn=l24; StringTokenizer mn1=new StringTokenizer(l24...(3,280,1580,600); nowon.setBackground(Color.cyan); sir i want to add StringTokenizer
StringTokenizer not returning proper result
StringTokenizer not returning proper result  I have this code... System.out.print("Enter the stack integers side by side with a space in between: "); StringTokenizer st=new StringTokenizer(br.readLine()); int a[]=new int[9000
Java StringTokenizer
Java StringTokenizer In this tutorial we will discuss about String Tokenizer in java. String Tokenizer allows an application to break into token. Java... string into token,  first create a object of the StringTokenizer class
how to use stringtokenizer on table? and display in table format.
how to use stringtokenizer on table? and display in table format.  table is retrieved from mysql database and each row contains data like(java,c,c++,.net
how to use stringtokenizer on table? and display in table format.
display result in row format  how to use stringtokenizer on table? and display in table format
Breaking a string into words without using StringTokenizer
Breaking a string into words without using StringTokenizer  how can we Break a string into words without using StringTokenizer ??   The given code convert the string into words. import java.util.*; class StringExample
java question - Java Beginners
java question  Given the string "hey how are you today?" how many...="hey how are you today?"; int count=0; StringTokenizer st=new StringTokenizer(str); while(st.hasMoreTokens()){ String s=st.nextToken(); count
java beginners - Java Beginners
java beginners  what is StringTokenizer? what is the funciton... the following links: http://www.roseindia.net/java/beginners/StringTokenizing.shtml http://www.roseindia.net/java/beginners/tokenizingjavasourcecode.shtml
java - Java Beginners
java  give the java programming syntex when the text like i love india is reverse and then give the output like i evol aidni.  Hi Friend...=""; StringBuffer sb=new StringBuffer(); StringTokenizer stk=new StringTokenizer
Java - Java Beginners
Java  I need a program in java. For ex, if I Give my input as "My Name is ram" The output to be"ram is Name My"  Hi Friend, Try... = new StringBuffer(str); StringTokenizer st = new StringTokenizer
STRINGS - Java Beginners
STRINGS  WRITE A JAVA PROGRAM TO REVERSE THE ORDER OF WORDS IN THE SENTENCE...EXAMPLE" " "ANT EATS APPLES"SHOULD BE RETURNED AS" "APPLES EATS ANT...); StringTokenizer st = new StringTokenizer(buffer.reverse().toString(), " "); while
java swing - Java Beginners
java swing  hello sir, Is it possible to show... InputStreamReader(fis)); StringTokenizer st1 = new StringTokenizer(br.readLine...) { StringTokenizer st2 = new StringTokenizer(line, " "); while(st2.hasMoreTokens
java - Java Beginners
Java compiler and interpreter  is there any online Java compiler... = "&/-*%+ "; StringTokenizer st = new StringTokenizer(input, str...://www.roseindia.net/java/beginners/StringTokenizing.shtmlamar
java vowel program - Java Beginners
java vowel program  Write a program to Print all the words that start...); String input = scan.nextLine(); final StringTokenizer st = new StringTokenizer( input, " ", true ); final StringBuilder sb = new
Java Strings problem - Java Interview Questions
Java Strings problem  How can you find a word which is repeating in maximum number of times in document, which is in text format in java?  ...[]) { String searchStr = "class"; StringTokenizer tokenizer; try
tokenizing a java file
tokenizing a java file    Hi i am new to java and i am trying to build lexecal analyser for java code , I am in the beginning want to read the file...) { //StringTokenizer st =new StringTokenizer(fstream); //System.out.println
java
capitalizeFirstLetter( String str ) { final StringTokenizer st = new StringTokenizer( str
core java - Java Beginners
("Enter String:"); String str=br.readLine(); StringTokenizer st=new StringTokenizer(str); int i=st.countTokens(); String str1[]=new String[6...://www.roseindia.net/java/ Thanks & Regards Amardeep
Java Reverse words of the String
Reverse words of the String Java Programming In this section, we are going... the string. Then we have converted the string into tokens using StringTokenizer...;= new StringTokenizer(buffer.reverse().toString(), " 
java - Java Beginners
LongestWord { String str = "Ram is intelligent boy"; StringTokenizer st = new StringTokenizer(str); String stringArray[] = str.split("\\s"); public String
java - Java Beginners
: "); String sen = scanner.nextLine(); StringTokenizer st = new StringTokenizer(sen); int counter = 0; while(st.hasMoreTokens
java test
java test  How to read the data from an .csv file and write into an xml file using java? (test_sample.csv(it should contain at least 39 lines)) i...(","); // // StringTokenizer st = new StringTokenizer(s, "\t"); // // while
Cyber Cafe Billing Application in Java
Cyber Cafe Billing Application in Java In this section, we are going to create...: "); String str = input.nextLine(); StringTokenizer stk = new StringTokenizer(str); while (stk.hasMoreTokens()) { String words = stk.nextToken
Java Util Package - Utility Package of Java
Java Util Package - Utility Package of Java       Java Utility package is one of the most commonly used packages in the java program. The Utility Package of Java consist
 

 

 

DMCA.com