When I run the below method and intentionally input a letter when a number is expected, I get a never-ending loop that doesn't prompt for more input. Why?
Your condition is to loop until itsAnInt ==true, lets start looping.
You enter character and then set itsAnInt =true, but because you entered character you catch exception.
after you catch exception you set itsAnInt = false. Program's next step is to check while loop's condition, which was continue until itsAnInt ==true, but we had itsAnInt = false.
Well, I tried removing the last "itsAnInt = false" and it didn't change a thing. I also know that itsAnInt is never made true when a non-numerical character is typed in. Here's the code I used to test that: