Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4

Help pleaseee! Thank you. https://code.sololearn.com/clZarLJxv9cu/?ref=app

26th Feb 2021, 11:29 AM
Bensho
Bensho - avatar
2 Answers
+ 2
In for loop, you are using arrbazLName.length() which is 5 but in arrays, double[] arrbazRPH = {150, 200, 250, 300,400}; double[] arrbazTD you have only 4 elements. So it raisr error at index 4(5th element). Add 1 more element to those arrays, error gets removed... Hope it helps...
26th Feb 2021, 12:00 PM
Jayakrishna 🇮🇳
0
Wow, thanks man a mistake on my part.
26th Feb 2021, 12:15 PM
Bensho
Bensho - avatar