Answers for "array out of bounds exception"

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 "array out of bounds exception"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language