How to check if a character representing a number?
For validation purposes we might need to check if the data entered by our user is a valid data for our application. A simple mechanism for checking if a character inputted is a number or not can be done by using
isDigit(char c) method. An example is shown below: