Programmers learn & share
0 votes
75 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)   | 75 views

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 (36.1k points)  
edited by
2,187 questions
2,514 answers
59 comments
241 users