File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes arrayindexout of bounds exeception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "arrayindexout of bounds exeception" Watch "arrayindexout of bounds exeception" New topic

arrayindexout of bounds exeception

Shilpa Beri

Joined: Oct 11, 2005
Posts: 2
hello friends

new to java world, just learning. help me with this problem i am struck up.

I am trying to write a program that multiplies two large integers.

here is my code but i am getting array index out of bounds.

just let me know how to resolve that arrayindex out of bounds problem


Rajesh Chandra
Ranch Hand

Joined: Jun 13, 2005
Posts: 55
Hi Shilpa,
After completing the loop for(int j=3;j>0;j--), the value of som is 2 and again variable som is changed by the expression som=som-i which makes som 0.So far so good now with i=2 and j=2 the value of som comes to -1 which is awkward for an arrays index.So the runtime raises the exception array index out of bounds.You have to find a way so that som doesnt fall beyond 0.
I agree. Here's the link:
subject: arrayindexout of bounds exeception
It's not a secret anymore!