Question: This picture is showing the error I am experiencing with this code below it. I know I'm missing something easy. CODE FOR ABOVE PICTURE: public

This picture is showing the error I am experiencing with this code below it. I know I'm missing something easy.

This picture is showing the error I am experiencing with this code

CODE FOR ABOVE PICTURE:

public class CheckstyleLab { private static final int arrSize = 10; public static void main(String[] args) { int[]squares = new int[arrSize]; for (int i = 0; i

}

----GRASP wedge2: working directory is [C:\Users\caugh\Desktop]. ----GRASP wedge2: actual command sent ["E:\jGRASP\bundled java\bin\java.EXE" CheckstyleLab]. ----GRASP wedge2: pid for process is 10688. Square of 1 is 0 Square of 2 is 1 Square of 3 is 4 Square of 4 is 9 Square of 5 is 16 Square of 6 is 25 Square of 7 is 36 Square of 8 is 49 Square of 9 is 64 Square of 10 is 81 Exception in thread "main" java.lang. ArrayIndexOutOfBounds Exception: Index 10 out of bounds for length 10 at CheckstyleLab.sumArray (CheckstyleLab.java:37) at CheckstyleLab.main(CheckstyleLab.java:27)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!