collector then collects and destroys it some time afterwards. A reference variable is null when it does not reference any object. Arrays Arrays in Java are created at runtime, just like class instances. Array length is defined at creation and cannot be changed. int[] numbers = new int[5]; numbers[0] = 2; numbers[1] = 5; int x = numbers[0]; Initializers // Long syntax int[] numbers = new int[] {20, 1, 42, 15, 34}; // Short syntax int[] numbers2 = {20, 1, 42, 15, 34}; Multi-dimensional arrays In Java, multi-dimensional arrays are represented as arrays of arrays. Technically, they are represented by arrays of references to other arrays. int[][] numbers = new int[3][3]; numbers[1][2] = 2; int[][] numbers2 = {{2, 3, 2}, {1, 2, 6}, {2, 4, 5}}; Due to the nature of the multi-dimensional arrays, sub-arrays can vary in length, so multi-dimensional arrays are not bound to be rectangular unlike C: int[][] numbers = new int[2][]; //Initialization of the first dimension only numbers[0] = new int[3]; numbers[1] = new int[2]; Classes Classes are fundamentals of an object-oriented language such as Java. They contain members that store and manipulate data. Classes are divided into top-level and nested. Nested classes are classes placed inside another class that may access the private members of the enclosing class. Nested classes include member classes (which may be defined with the static modifier for simple nesting or without it for inner classes), local classes and anonymous classes. Declaration Instantiation Non-static members of a class define the types of the instance variables and methods, which are related to the objects created from that class. To create these objects, the class must be instantiated by using the new operator and calling the class constructor. Foo foo = new Foo(); Accessing members Members of both instances and static classes are accessed with the . (dot) operator. Accessing an instance member Instance members can be accessed through the name of a variable. String foo = "Hello"; String bar = foo.toUpperCase(); Accessing a static class member Static members are accessed by using the name of the class or any other type. This does not require the creation of a class instance. Static members are declared using the static modifier. public class Foo { public static void doSomething() { } } // Calling the static method Foo.doSomething(); Modifiers Modifiers are keywords used to modify declarations of types and type members. Most notably there