Software Engineers Handbook/Language Dictionary/Java

Java
Here is the Java wikipedia entry.

Type
Java is a full, procedural, object-oriented language.

General Syntax
The typical statement is completed by a semi-colon. For the assignment of b to a use:

Comments
Block comments are specified by a starting /* and ending */ They can span multiple lines.

Scope
Scope is defined by curly braces.

Conditional Statements
If and only if A is equal to B assign C to D, otherwise, assign E to F.

or

Alternatively, a switch statement can be used for multiple choice operations. This sample converts a number input to text.

Looping Statements
This code counts from 0 to 9, adding up the contents of the array.

This code repeats until the number 4 is found. If this runs off of the end of the array, there could be a problem.

This code increments the counter before the check is made, so that it starts with element 1.

Containers
Containers inherit from the Collection class. See the java.util package for specific containers including List, LinkedList, Queue, Stack, Dictionary and HashMap.

Algorithms
The Collection class has algorithms like sort.

Garbage collection
Garbage collection is automatic.

Physical Structure
Code is generally kept in files with a .java extension. It is compiled into Java byte code into files with .class extensions.

Tips
= // assignment == // comparison, is equal to Often using the one you don't want will compile, and will produce results you did not expect.
 * Classes in the Java packages are capitalized, methods are not.
 * Everything is a pointer. Use a clone method to avoid operating on the original element of a Collection.
 * Arrays start with index 0.
 * Don't confuse these two:

Web References

 * Java wikibooks page
 * The Sun java page has the API online as well as code examples.

Books and Articles
paper references here