do{
out.println("\n---------------------------------");
out.println("---------------------------------");
out.print("Please type your acces card number: ");
try{
card = input.nextInt();
if(card.length != 10){
out.println("The number you typed is incorrect");
out.println("The number must be 10 numbers long");
continue;
}
}
catch(InputMismatchException ex){
}
}while(true);
Im trying to make card be 10 characters long. Like (1234567890), and if the user inputs (123) or (123456789098723) an error message should appear. card.length doesnt seem to work.