Hi Sudhir, The split method returns an array of Strings which is assigned to your array firstname[]. If the name you entered consists of only a first name, the string array returned has the length 1. If you entered first and last name, the length would be 2. Now in the line "if ((j == 0) || ..." your counter j will allways take values from 0 to 2. This may be more than the length of the array and that causes your array-out-of-bound-exception.
hth, Rita --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
