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];
int i=0;
do
{   
    a[i]=Integer.parseInt(st.nextToken());
    i++;
}while(st.hasMoreTokens());

When I print the elements in the array it prints me nothing. I tried to change datatype to String still the problem persists. And when I change the condition in the do...while loop I get only half of the elements given in the input when I print the array.

View Answers









Related Tutorials/Questions & Answers:
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  What is difference between string and stringtokenizer
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
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 on table? and display in table format.
display result in row format  how to use stringtokenizer on table? and display in table format
program using StringTokenizer
program using StringTokenizer  I want to know about StringTokenizer,so can you please explain it with an example
returning a value from Threads
returning a value from Threads  Hello I have worker pattern that uses ExecutorService to schedule Thread execution but getting stuck at some point when returning a value using Future.I have code snippet below: ExecutorService
ModuleNotFoundError: No module named 'proper'
ModuleNotFoundError: No module named 'proper'  Hi, My Python... 'proper' How to remove the ModuleNotFoundError: No module named 'proper'... to install padas library. You can install proper python with following command
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
Date not getting in proper format
Date not getting in proper format  import java.util.*; class Date { public static void main(String[]args) { Date d = new Date(100000000000L); System.out.print("1st date"+d.toString()); } } out put:- 1st date@3e25
result problem
result problem  sir,i have written program given below but that program is not giving proper output.pls help me import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*;ADS_TO_REPLACE_1 class
returning doubles with 2 decimals JAVA
returning doubles with 2 decimals JAVA  Hi all. I'm writing a program where users input the cost of an item (in the constructor), so for example, Item (string name, double cost, int qty) { ... } I have a method public double
ModuleNotFoundError: No module named 'django-pg-returning'
ModuleNotFoundError: No module named 'django-pg-returning'  Hi, My... named 'django-pg-returning' How to remove the ModuleNotFoundError: No module named 'django-pg-returning' error? Thanks   Hi
ModuleNotFoundError: No module named 'lanms-proper'
ModuleNotFoundError: No module named 'lanms-proper'  Hi, My Python... 'lanms-proper' How to remove the ModuleNotFoundError: No module named 'lanms-proper' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'mr-proper'
ModuleNotFoundError: No module named 'mr-proper'  Hi, My Python...-proper' How to remove the ModuleNotFoundError: No module named 'mr-proper' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'proper-auth'
ModuleNotFoundError: No module named 'proper-auth'  Hi, My Python... 'proper-auth' How to remove the ModuleNotFoundError: No module named 'proper-auth' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'proper-config'
ModuleNotFoundError: No module named 'proper-config'  Hi, My... 'proper-config' How to remove the ModuleNotFoundError: No module named 'proper-config' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'proper-form'
ModuleNotFoundError: No module named 'proper-form'  Hi, My Python... 'proper-form' How to remove the ModuleNotFoundError: No module named 'proper-form' error? Thanks   Hi, In your python environment
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
display result
display result  i want a code that takes input from user through dropdown box and display the result into table.all the values regarding the user input must be displayed. i am using mysql database   hi i want study
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
method returning null on JSP page.Plz HELP!!!
method returning null on JSP page.Plz HELP!!!  public String getServerAddress(String sName,int sPort,String pKey) { String... it is returning null while the parameter values are successfully passed.while I am
method returning null on JSP page.Plz HELP!!!
method returning null on JSP page.Plz HELP!!!  public String getServerAddress(String sName,int sPort,String pKey) { String... on the jsp page it is returning null while the parameter values are successfully
Which website provides proper tutorials?
Which website provides proper tutorials?  Hi, I want to learn programming languages and searching for the websites. Which are the websites to learn programming languages? Which website provides proper tutorials? Thanks  
why above code returning the value of squares is 82... even after returning an increnented value of squares... please help me...
why above code returning the value of squares is 82... even after returning an increnented value of squares... please help me...   public class d55 { int squares = 81; public static void main(String
ModuleNotFoundError: No module named 'result'
ModuleNotFoundError: No module named 'result'  Hi, My Python... 'result' How to remove the ModuleNotFoundError: No module named 'result'... to install padas library. You can install result python with following command
result after compilation
result after compilation  public class MainCls { public static void main(String argv) { System.out.println("My text
Why Scikit is a proper library for machine learning?
Why Scikit is a proper library for machine learning?  Hi, I am... for the tutorials to learn: Why Scikit is a proper library for machine learning? Try... Scikit is a proper library for machine learning?". Also tell me which
how to make a proper arrangement of a string - JSP-Servlet
how to make a proper arrangement of a string  Dear sir, I have a string matter that is stored in a arraylist .I amgetting that string from... .Thanks Hr. so now i want to send a matter with a proper manner i.e following
What's the proper way to test a class with private methods using JUnit?
What's the proper way to test a class with private methods using JUnit?  What's the proper way to test a class with private methods using JUnit
Result=Set - Java Beginners
Result=Set  Hi Friend, Can u tell how to get the count of records. in a select operation like sqlstmt="SELECT * FROM search_log_tab WHERE... result set, first move the pointer from first record to last record and get
Sort Result set
Sort Result set   I build a connect for my page with the database and then read all rows and show it in a table, I want to change the view of my data to be sorted uppon a specific column when click on the column name, so what
result analysis issue
result analysis issue  i have given 100 users in my thread group for http sampler.some threads r getting response and some threads r getting error response.the error response shown in view results tree listener is as shown below
how to append data to XML file in proper format using JSP
how to append data to XML file in proper format using JSP  hello i... not getting XML file in proper format as XML rules.lease help me to get XML file in proper format.I am using Jdeveloper. My code: <%@page import="java.io.
write the result into excelsheet
write the result into excelsheet  package reader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import... the result in to the same excel file....... please help me. if username is superadmin
hide and show result in jsp
hide and show result in jsp  what codes do i have to change to make my result display if only i enter the correct value? suppose if i click search,then the result will be display at the bottom.. if not.. only the header
getting result in table dynamically - Struts
getting result in table dynamically  How do i get result in tabular format dynamically using our own tags
ModuleNotFoundError: No module named 'grep-result'
ModuleNotFoundError: No module named 'grep-result'  Hi, My Python... 'grep-result' How to remove the ModuleNotFoundError: No module named 'grep-result' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'cdumay-result'
ModuleNotFoundError: No module named 'cdumay-result'  Hi, My... 'cdumay-result' How to remove the ModuleNotFoundError: No module named 'cdumay-result' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'result_py'
ModuleNotFoundError: No module named 'result_py'  Hi, My Python... 'result_py' How to remove the ModuleNotFoundError: No module named 'result... have to install padas library. You can install result_py python with following
ModuleNotFoundError: No module named 'result-quality'
ModuleNotFoundError: No module named 'result-quality'  Hi, My... named 'result-quality' How to remove the ModuleNotFoundError: No module named 'result-quality' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'thumbor_no_result'
ModuleNotFoundError: No module named 'thumbor_no_result'  Hi, My... named 'thumbor_no_result' How to remove the ModuleNotFoundError: No module named 'thumbor_no_result' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'typed-result'
ModuleNotFoundError: No module named 'typed-result'  Hi, My Python... 'typed-result' How to remove the ModuleNotFoundError: No module named 'typed-result' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cdumay-result'
ModuleNotFoundError: No module named 'cdumay-result'  Hi, My... 'cdumay-result' How to remove the ModuleNotFoundError: No module named 'cdumay-result' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'deferred-result'
ModuleNotFoundError: No module named 'deferred-result'  Hi, My... named 'deferred-result' How to remove the ModuleNotFoundError: No module named 'deferred-result' error? Thanks   Hi, In your python
what is proper way to save pictures in SQl database and call it through JSP ?
what is proper way to save pictures in SQl database and call it through JSP... type i can't see text on same page. Please tell me proper way to do this, and Please send me a proper programe code regarding this segment(If possible). Please
Result interface in Struts 2.2.1
Result interface in Struts 2.2.1 Struts Result interface is a public interface of package com.opensymphony.xwork2. It extends Serializable interface. All the known classes such as PlainTextResult, ServletRedirectResult, 
select Query result display problem
select Query result display problem  Hi, String SQL_QUERY ="from Cc"; Query query = session.createQuery(SQL_QUERY); for(Iterator it=query.iterate();it.hasNext();){ Object[] row = (Object[]) it.next

Ads