Java Error “Exception in thread “main” java.util.InputMismatchException” On an Array program

First of all, remember to indent your code for readability.

Concept 1.

for (int i=0;i<=9;i++){

area[i];// Use this for String Input


s.nextLine();//Use this for going to next line of input


Concept 2.


// compare Strings using compareTo method (which returns 0 if equal

Rest of your code and concepts are correct 🙂

Leave a Comment