my problem is when i type NN to this code it ends my program..but i want that is i type more than one char it reloops again..
help please thank you
do{ System.out.print("\nDo You Want To Try Again? [Y/N]? "); input = scan.next(); if(input.charAt(0) == 'n' || input.charAt(0) == 'N') { System.exit(0); } }while(!(input.charAt(0) == 'y' || input.charAt(0) == 'Y' || input.length() >= 2)); }while(input.charAt(0) == 'y' || input.charAt(0) == 'Y' ); } }