Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exceptions

 
prans rao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i run a java program with "Integer.parseInt" in it,
i am getting an error "Array index out of bounds "exception at
that step. But it not showing any compilation error.
Every program i write with that step, i am getting error.
I want to enter values at runtime manually through this, but i am getting that exception.
Here is my one of programs i am getting error.


Here i am getting Exception at "int a1=.."

JCE: please use code tags, they make your code more readable.
[ August 08, 2008: Message edited by: Joe Ess ]
 
Joe Ess
Bartender
Pie
Posts: 9259
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the first line of your main method, try printing out the length of the string array s:

Let us know what you get.
 
Rob Spoor
Sheriff
Pie
Posts: 20496
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please CarefullyChooseOneForum. This has nothing to do with I/O.

I'm sure Joe can move this to the beginner's forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic