Read from the Console or Keyboard | Complete Java Course for Beginners #13

preview_player
Показать описание
In this video I will show how a Java application can read from a console, from a keyboard. I will show how the input values are parsed and stored into variables. I will also show how to validate input values.

Content:
* Read from the console, from the keyboard, with Scanner and next;
* Read a complete line from the console with Scanner and nextLine;
* Read numbers from the console with Scanner and nextInt, nextFloat, nextDouble or nextBigDecimal;
* Validate a string before reading it with hasNext();
* Validate a string with a regex before reading it with hasNext and a Pattern.

Рекомендации по теме