Guest_imported
New member
- Jan 1, 1970
- 0
How can check if the value I type on a textbox is an integer or not?
thank you.
thank you.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
String idText = "12";
int id = null;
try {
id = Integer.parseInt(idText);
}
catch (NumberFormatException nfe) {
// If Exception then it is not an int.
// Do Error Handling.
}
// If no exception then it is an int
System.out.println(id);
int id;