Common Errors

Out-of-Bounds Error

This is what you’ll get when trying to access an element, “slot,” or index that doesn’t exist.

Quick fix:

  1. Print the length of an array:

println(arrayName.length);

2. Make sure the index you are trying to access is LESS THAN the length.

Last updated