Answers for "runtime error array index out of bounds"

0

Array Index Out Of Bounds Exception

for(i = 1; i <= height.length; i++){
        heightAsString = JOptionPane.showInputDialog("Please Enter The Height Of Person " + i);
        height[i-1] = Double.parseDouble(heightAsString);

        if(height[i-1] > 1.8){
            over18 += 1;
        }

        if(height[i-1] < 1.6){
            under16 += 1;
        }
    }
Posted by: Guest on September-02-2021

Code answers related to "runtime error array index out of bounds"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language