What's wrong with my dowhile?
I still very new to java and I can't figure out why this loop falls straight through, no matter what. Even if the user doesn't enter an integer, the code just assigns wepchoice a null value.
System.out.print("Which do you choose? ");
boolean continueloop=true;
Scanner sc =new Scanner(System.in);
do{
try{
int wepchoice = sc.nextInt()-1;
player.setWeapon(startwep[wepchoice]);
continueloop=false;
}catch (InputMismatchException inputMismatchException){
sc.nextLine();
System.out.println("Invalid response, try again.");
}
}while (continueloop);
No runtime error, no compiling problems. Just doesn't repeat the loop.
I can't recall ever having this much trouble with a loop before.(Though I
AM very new to exception handling).
Help?

