
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.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
