#java #scanner
The Scanner class is mainly used to get the user input, and it belongs to the java.util package. In order to use the Scanner class, one need to create an object of the class and use any of the Scanner class methods.
Method Description
nextBoolean() Reads a boolean value from the user
nextByte() Reads a byte value from the user
nextDouble() Reads a double value from the user
nextFloat() Reads a float value from the user
nextInt() Reads a int value from the user
nextLine() Reads a String value from the user
nextLong() Reads a long value from the user
nextShort() Reads a short value from the user
If user enter wrong input (e.g. text in a numerical input), user will get an exception/error message (like "InputMismatchException").
In questa pagina del sito puoi guardare il video online Input in JAVA | Using Scanner Class della durata di ore minuti seconda in buona qualità , che l'utente ha caricato AKD Classes 28 luglio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 52 volte e gli è piaciuto 8 spettatori. Buona visione!