Hi all... This may sound novice but I am new to Java.. actually still learning.
I have the following lines of code to get an input
InputStreamReader reader = new InputStreamReader(System.in);
reader.read(charBuff);
However, I want to restrict the user input to only integer or float values. The user should not be able to input characters. Is it possible? If so, how to do it?
Thanks!
I have the following lines of code to get an input
InputStreamReader reader = new InputStreamReader(System.in);
reader.read(charBuff);
However, I want to restrict the user input to only integer or float values. The user should not be able to input characters. Is it possible? If so, how to do it?
Thanks!