title: Loop Until A Key Is Pressed Java
body: <p>How do I stop a loop when a certain key is pressed.I want to create an average calculator where you input numbers and it will give you the average.I made a counter for the amount of numbers that is being entered.However I need to stop this counter when the user is done inputting all the numbers they need.</p>