Java 45: Handle InputMismatchException when string is input instead of a number using if-statements

preview_player
Показать описание
Avoid an InputMismatchException when a number is expected but a string ins entered instead - using if-statements.
Based on the changes we did in this program, it now avoids a NumberFormatException.

Рекомендации по теме
Комментарии
Автор

Hello, what if the user press Enter the first time aka pass the empty string to your method ? I think you have to check for this particular case.
Anyway, just stumble upon your channel with seems really great.
+1 subscriber as you seem publish content regularly.
Keep it on!

jipeejoce
Автор

Hi. Great job. Do you have same video In java Android Studio? Thanks

ailekzavy
welcome to shbcf.ru