• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
14 views

Problem :

I am a beginner to Java programming. While executing my program i got below error
exception in thread "main" java.lang.arrayindexoutofboundsexception: 10
by (6.9k points)  

1 Answer

0 votes

Solution :

The problem is you have 50 students in your class and you want to view the value of the 51st student

if you make this int i[4] then i takes values i[0] i[1] i[2] i[3]

ftp resolve your problem you can try bellow code sample

double[] array = new double[50];

    for (int j = 0; j < 24; j++) {

    }

    for (int k = 25;  < 50; k++) {

    }
by (21.9k points)  
edited by
...