This discussion is archived
9 Replies Latest reply: Mar 17, 2007 9:11 AM by JosAH RSS

OutOfBoundsException with char array

807606 Newbie
Currently Being Moderated
in the catch part how can i delete the last char in the array so it doesnt keep giving me the exception? Thanks for any help.
try
{
     passWord[counter] = e.getKeyChar();
     counter++;
     System.out.print("*");     
}
catch(ArrayIndexOutOfBoundsException b)
{
     System.out.println("Your passwords is too long, use back space to go back");
         //need statement to remove last char in the array
}