Introduction to Programming in Java:   Standard Libraries



Input and output libraries.

Here is a list of the input and output libraries that we use throughout the textbook.

§ PROGRAM DESCRIPTION / JAVADOC
1.5 StdIn.java read numbers and strings from standard input
1.5 StdOut.java write numbers and strings to standard output
1.5 StdDraw.java draw geometric shapes in a window
1.5 StdAudio.java create, play, and manipulate sound
2.2 StdRandom.java generate random numbers
2.2 StdStats.java compute statistics
2.2 StdArrayIO.java read and write 1D and 2D arrays
3.1 In.java read data from files and websites
3.1 Out.java write data to files
3.1 Draw.java draw geometric shapes
3.1 Picture.java process images
3.2 Stopwatch.java measure running time
The file stdlib.jar bundles together all of the I/O libraries above into a .jar file.


Accessing the libraries.

There are a number of ways to access the libraries:


Q. If I use a named package to structure my code, the compiler can no longer access the libraries in stdlib.jar. Why not? The libraries in stdlib.jar are in the "default" package.

A. In Java, you can't access classes in the default package from a named package. If you need to use our standard libraries with a named package, you must put our libraries in a package, as in this solution.