Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 09-30-2019, 10:35 PM   #1
Kvitlekh
adept
 
Kvitlekh's Avatar
 
Join Date: Feb 2007
Posts: 882
Cannot understand why I am getting this error [Java]

This is not homework.

I cannot understand why I am getting an IndexOutOfBounds error. Can someone please help? It's driving me crazy.

https://pastebin.com/cspZuHHD
Kvitlekh is offline   Reply With Quote
Old 09-30-2019, 11:33 PM   #2
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 24,600
Re: Cannot understand why I am getting this error [Java]

I've not gone deep into the code but it's because this
Arrays.asList(notAbundantSummable).indexOf(sum)
returns -1, which it does because the value of sum is not in your array
RustyBrooks is offline   Reply With Quote
Old 10-08-2019, 04:40 PM   #3
antialias
journeyman
 
Join Date: May 2018
Posts: 390
Re: Cannot understand why I am getting this error [Java]

looks like you're running into an issue because your arrays starting indexing the first element at 0 (so the last element in an array of length n is the item[n-1] ) while in a List object the index starts at 1 for the first object (the last object of a List of length n is at element n)
antialias is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 01:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online