Java Programming Cheatsheet
We summarize the most commonly used Java language features and APIs in the textbook.
Hello, World.
Editing, compiling, and executing.
Built-in data types.
Declaration and assignment statements.
Integers.
Floating-point numbers.
Booleans.
Comparison operators.
Printing.
Parsing command-line arguments.
Math library.
The full java.lang.Math API.![]()
Java library calls.
Type conversion.
Anatomy of an if statement.
If and if-else statements.
Nested if-else statement.
Anatomy of a while loop.
Anatomy of a for loop.
Loops.
Break statement.
Do-while loop.
Switch statement.
Arrays.
Inline array initialization.
Typical array-processing code.![]()
Two-dimensional arrays.
Inline initialization.![]()
Our standard output library.
The full StdOut API.![]()
Formatted printing.
Our standard input library.
The full StdIn API.![]()
Our library for array input and output.
The full StdArrayIO API.![]()
Our standard drawing library.
The full StdDraw API.![]()
Our standard audio library.
The full StdAudio API.![]()
Our standard picture library.
The full StdPicture API.![]()
Command line.
Redirection and piping.
Functions.
Libraries of functions.
Our standard random library.
The full StdRandom API.![]()
Our standard statistics library.
The full StdStats API.![]()
Using an object.
Instance variables.
Constructors.
Instance methods.
Classes.
Object-oriented libraries.
Java's String data type.
The full java.lang.String API.![]()
Java's Color data type.
The full java.awt.Color API.![]()
Our input library.
The full In API.![]()
Our output library.
The full Out API.![]()
Our picture library.
The full Picture API.![]()
Our stack data type.
The full Stack API.![]()
Our queue data type.
The full Queue API.![]()
Iterable.
Our symbol table data type.
The full ST API.![]()
Our set data type.
The full SET API.![]()
Our graph data type.
The full Graph API.![]()