9 Replies Latest reply: Mar 17, 2007 11:11 AM by JosAH RSS

    OutOfBoundsException with char array

    807606
      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
      }