Hello, and welcome to JavaRanch!
Kudos for using code-tags in your first post, but you didn't actually place the code inside them, so I went ahead and fixed that for you
Now for the problem, one source of a possible IndexOutOfBoundsException is the
get() call at line 3 if the
list is empty.
Two other possible sources can be found inside the body of the for-loop when it reaches the last iteration.
Ps. I'm assuming that
list and
numList actually should be the same reference and this is a copy-paste error?
Edit: Awww, too late.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.