Getting Started with Java
This is a 100% free course, but we need you to first join or login to watch this video.Alright, join or login here.
This video shows an example of Buffered Reader, Scanner and Console in Java. To take input from the user with a BufferedReader, create its object from an InputStreamReader and call its readLine() method. To take input from the user using a Scanner, create its object and call the next(), nextInt(), nextBoolean(), nextDouble() and so on. Use the hasNext(), hasNextInt(), hasNextDouble() and so to check if the user actually entered valid input. To take input from the user using a Console class, call System.console() that returns a Console object and call its readLine() method. This object will be null if you run this code from an IDE such as IntelliJ