Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question