foreach loop error throws outofbounds exception after taking input

how to solve array index out of bounds exception in java
how to handle arrayindexoutofboundsexception in java
throw index out of bounds exception java
array index out of bound exception - stack overflow
arrayindexoutofboundsexception example
index out of bounds exception java arraylist
java array index out of bounds exception 0
how to avoid array index out of bound exception