Java #Scanner Input Types
#ScannerClass helps to take the standard input stream in #Java
we need some methods to extract data from the stream
Method:-
nextBoolean()
nextByte()
nextDouble()
nextFloat()
nextInt()
nextLine()
nextLong()
nextShort()
#ScannerClass in #Java
Read user input
1. Import java.util.Scanner
2.We passed the System.in in the Scanner class constructor to read the data from standard input
3. nextLine() method to read the line of text entered by the user
#Scanner
#ScannerClass in Java
Scanner is a class
in java.util package
used for obtaining input
Using the #Scanner class is the easiest way to read input in a Java Program
#Java#JavaProgramming
🧵🧵🧵