Lesson 2

Class header:

public class ClassName {

}

Main method:

public static void main(String[] args) {

}

Lesson 3

Create an object with: ClassName objectName = new ClassName();

Lesson 6

Subclass: Inherits the behaviors and attributes of a superclass

Inheritance: The subclass inherits the behaviors and attributes of the superclass

To extend a class, type: public class [subclass] extends [superclass]

Inside the extended class, you need to create the constructor signature for the subclass, and type super() to call the superclass constructor and methods.

Like this:

public class PainterPlus extends Painter {
    public PainterPlus() {
        super();
    }
}

Lesoon 7 Methods

Methods are defined with:

public void [methodName]() {
    // code
}

These can be later called with an object.

For example, in Lesson 7 #2, I created a method called turnRight(). This is then called by with myPainterPlus.turnRight();

Lesson 9 Loops

While loops: while (condition()) {}

Lesson 10 Conditionals

If statements: if (condition()) {}

If else statements:

if (condition()) {
    // code
} 
else {
    // code
}

To specify something not happening, use !.

Ex: if (!condition()) {} // if condition is false, proceed with if statement

Lesson 12 Decomposition and Design

Important: Code readability is very important. Also, a method should contain few lines of code (around 1-10). Each method should only be used to perform one task.