Let's refer to Lesson 7 Part 2 on Code.org

MyNeighborhood.java

import org.code.neighborhood.Painter;

public class MyNeighborhood {
  public static void main(String[] args) {

    PainterPlus myPainterPlus = new PainterPlus();
    // Lesson 6 Level 3
    // TO DO #1: Instantiate a PainterPlus object.

    // Lesson 7 Level 2
    // TO DO #1: Navigate the PainterPlus object
    // to the traffic cone.
    myPainterPlus.move();
    myPainterPlus.move();
    myPainterPlus.move();
    myPainterPlus.turnRight();
    myPainterPlus.move();
    myPainterPlus.move();

  }
}

PainterPlus.java

import org.code.neighborhood.*;


public class PainterPlus extends Painter {

   public PainterPlus() {
      super();
   }

  public void turnRight() {
    turnLeft();
    turnLeft();
    turnLeft();
  }
}

Defining a class

Syntax: public class classname

// Example from code.org
public class MyNeighborhood

Creating an object

Syntax: Class object = new Class();

// Example from code.org
PainterPlus myPainterPlus = new PainterPlus();
// where PainterPlus is the class and myPainterPlus is the object

Object calling a method

This is what runs the code
Syntax: object.method();

// Example from code.org
myPainterPlus.turnRight();

Extends

superclass - class being extended
subclass - class that is extending
The result is that the super and subclass will have the same attributes

// syntax 
public class PainterPlus extends Painter { 
    public PainterPlus() {
        super();
    }
}
// example from code.org
public class PainterPlus extends Painter {

   public PainterPlus() {
      super();
   }

  public void turnRight() {
    turnLeft();
    turnLeft();
    turnLeft();
  }
}