• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

arrayindexout of bounds exeception

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

thanks

shilpa
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
cheers
Rajesh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic