I think that the error is not the same as the other people have
mentioned, since they did not refer to the correct line number.

The error message is clear:

run:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
        at ArrayHomeProject.main(ArrayHomeProject.java:28)
Java Result: 1


The reference "ArrayHomeProject.java:28" indicates that the error is
in line #28

Which is

        if((j==0)||(max.length()>firstName[j].length()))

On this line you used the variable: firstName[j].length()

But I think that you meant to use: firstName.length()

Tommy

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to