A
A
Anatoly2015-03-17 22:54:18
Java
Anatoly, 2015-03-17 22:54:18

How to check type matching in Java?

In the example below, if a non-numeric value is entered on request or an empty string, the parser swears and the program crashes.
How to make a loop to check the condition of the entered number, if a value different from the number is entered, then the request is repeated until the number is entered?

System.out.println("Введите число и нажмите <ENTER>");
            String fNumb = reader.readLine();
            int fInumb = Integer.parseInt(fNumb);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2015-03-17
@Anatol_s

stackoverflow.com/questions/1102891/how-to-check-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question