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 how to take input from the user in Java using a BufferedReader and Scanner. The BufferedReader requires you to create an InputStreamReader object that reads one character at a time from the binary input stream System.in. The Scanner reads the input entered by the user and splits it on the basis of the space character which by default is its delimiter. It generates tokens which can be read using the next(), nextInt(), nextFloat(), nextDouble(), nextBoolean() and so on methods.