File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "exceptions" Watch "exceptions" New topic


prans rao

Joined: Aug 08, 2008
Posts: 9
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

Joined: Oct 29, 2001
Posts: 9045

In the first line of your main method, try printing out the length of the string array s:

Let us know what you get.

[How To Ask Questions On JavaRanch]
Rob Spoor

Joined: Oct 27, 2005
Posts: 19908

Please CarefullyChooseOneForum. This has nothing to do with I/O.

I'm sure Joe can move this to the beginner's forum.

How To Ask Questions How To Answer Questions
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: exceptions