If you’re looking to learn a programming language that’s cross-platform and easily accessible, Java is one of the most practical languages out there. This handy cheat sheet helps you keep track of the basics while you begin to learn.
Java has been around for quite some time and it’s one of the most widely used languages when it comes to web apps, applets, and even some Android app development. This cheat sheet, from Princeton University’s Introduction to Programming in Java course, makes a great reference for the basics you need to know, like structure, input/output, data types, and functions. Check out the the link below to dig a little deeper into Java at Princeton University’s web site.
This appendix summarizes the most commonly-used Java language features in the textbook. Here are the APIs of the most common libraries.
Hello, World.
Editing, compiling, and executing.
Built-in data types.
Declaration and assignment statements.
Integers.
Floating-point numbers.
Booleans.
Comparison operators.
Parsing command-line arguments.
Math library.
The full java.lang.Math API.
Type conversion.
If and if-else statements.
Nested if-else statement.
While and for loops.
Break statement.
Do-while loop.
Switch statement.
Arrays.
Compile-time initialization.
Typical array-processing code.
Two-dimensional arrays.
Compile-time initialization.
Ragged arrays.
Our standard output library.
The full StdOut API.
Our standard input library.
The full StdIn API.
Our standard drawing library.
The full StdDraw API.
Our standard audio library.
The full StdAudio API.
Redirection and piping.
Functions.
Libraries of functions.
Our standard random library.
Our standard statistics library.
Using an object.
Creating an object.
Instance variables.
Constructors.
Instance methods.
Classes.
Object-oriented libraries.
Java’s String data type.
The full java.lang.String API.
Note: the java.lang.StringBuilder API is similar, but StringBuilder supports some operations more efficiently than String (notably, string concatenation) and some operations less efficiently (notably, substring extraction).
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.
Compile-time and run-time errors.
Here’s a list of errors compiled by Mordechai Ben-Ari. It includes a list of common error message and typical mistakes that give rise to them.
via lifehacker.com; introcs.cs.princeton.edu