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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

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.

No responses yet