title: Extending abstract classes
body: <p>MyMath's constructor is supposed to call Homework's constructor, but super(); returns an error 'cannot find symbol'. It should not have any arguments.
  Also, I am confused about how to call the method createAssignment using an arraylist, but I have to use it. Any advice?</p>
  
  <h2>Homework</h2>
  
  <pre><code>public abstract class Homework {
      private int pagesToRead;
      private String typeHomework;
  
      public Homework(int pages, String hw) {
          // initialise instance variables
          pagesToRead = 0;
          typeHomework = "none";
      }
  
      public abstract void createAssignment(int p);
  
      public int getPages() {
          return pagesToRead;
      }
  
      public void setPagesToRead(int p) {
          pagesToRead = p;
      }
  
      public String getTypeHomework() {
          return typeHomework;
      }
  
      public void setTypeHomework(String hw) {
          typeHomework = hw;
      }
  
  
  }
  </code></pre>
  
  <h2>MyMath</h2>
  
  <pre><code>public class MyMath extends Homework {
  
      private int pagesRead;
      private String typeHomework;
  
      public MyMath() {
          super();
      }
  
      public void createAssignment(int p) {
          setTypeHomework("Math");
          setPagesToRead(p);
      }
  
      public String toString() {
          return typeHomework + " - " + pagesRead;
      }
  }
  
  public class testHomework {
      public static void main(String[] args) {
          ArrayList&lt;Homework&gt; list = new ArrayList&lt;Homework&gt;();
          list.add(new MyMath(1));
          list.add(new MyJava(1));
  
          for (Homework s : list) {
              s.createAssignment();
          }
      }
  
  }
  </code></pre>