// here we are writing a class again // this class will be our testing class public class Test { // to write a main method, or a method that can be run, you always // write the line of code "public static void main(String[] args)" // this will be the method that gets run first when you compile and // run this class public static void main(String[] args) { // first we instanciate a new ArrayIntList, which is // the class that we wrote. To do that we first create // a variable by giving the type(ArrayIntList) followed // by the name (test) and then we set it equal to // a "new" then I call our empty constructor( ArrayIntList() ) ArrayIntList test = new ArrayIntList(); // then I called the add method in our test ArrayIntList, // to do this, I use the variable test, followed by a period, then // followed by the name of the method that I want to call and I input // my parameters test.add(0, 1); // add the number 1 at index 0 // this tests adding at the front of the list // to print out to standard out, or the console, then you write // "System.out.print" if you just want to print or "System.out.println" // if you want to print and then move to a new line System.out.println("Test 1: " + test.toString()); test.add(1, 2); // add the number 2 at index 2 // this tests adding at the back of the list System.out.println("Test 2: " + test.toString()); test.add(0, 3); // add the number 3 at index 0 // this tests adding somewhere that will cause a shift System.out.println("Test 3: " + test.toString()); } }