Java Stdin and Stdout

Charles Butler Jr
2 min readSep 3, 2021

Continuing our journey down the Java rabbit hole we land on a new principle in the code base. That of reading input. In Java most challenges we’ll face have us reading input from stdin (aka standard input) and somehow manipulating that data to output to stdout. One way Java helps with this need is by using what is called the scanner class.

In order to use the scanner class we have to first import it.

Using import java.util will give us access to the package and a few other methods as well as the scanner class. Packages as you remember are give us access to prewritten classes that have methods attached to them. We can call classes specifically from a package or the entire package. For instance if we wanted to JUST use the scanner class in the java.util package we could do so like this.

--

--

Charles Butler Jr
Charles Butler Jr

Written by Charles Butler Jr

Pre-Med student turned software engineer. Hoping to make code make sense & make sense out of all my code.