I'm trying this:
Scanner keyboard = new Scanner(System.in);
char[] character = keyboard.next().toCharArray();
while (character.length != 5) {
keyboard = new Scanner(System.in);
character = keyboard.next().toCharArray();
}
Until you introduce 5 character keeps asking you to introduce the 5 characters again but when i try to introduce the special characters 'ñ' or 'ç' it doesn't work, i have tried it without the while to print the results and the only thing that prints are squares . How could this be solved?
I'm using NetBeans IDE 7.4.
By it doesn't work I mean I just keep asking to introduce more characters and it is just stuck until you introduce 5 normal characters.