Could someone help me figure out what am I missing? It not printing out "Math" in my main class. Thanks
public abstract class Homework { private int pagesRead; private String typeHomework; public Homework() { pagesRead = 0 ; typeHomework = ""; } public void setPage(int page) { pagesRead = page; } public int getPage() { return pagesRead; } public void setType(String type) { typeHomework = type; } public String getType() { return typeHomework; } public abstract void createAssignment(int p); }
public class MyMath extends Homework { public MyMath() { } public void createAssignment(int p) { setPage(p); setType("Math"); } public String toString() { return getType() + " - " + getPage(); } }