I have to do this program with a superclass called Document
and two subclasses (DVD and book). Basically the two subclasses inherit the attributes of Document + one or two specific attributes for each.
This is my superclass:
public class Document {
public String nom;
public int copiesDispo;
public String noRef;
public static int nbDocs;
/*
** Constructor(s)
*/
public Document(String nom, String noRef) {
this.nom = nom;
this.noRef = noRef;
this.copiesDispo = copiesDispo;
nbDocs++;
}
}
And here is what I have so far for the subclass book:
public class Livre extends Document {
public Livre() {
super();
}
}
This doesn't compile though, it seems like I can't do that but I have done this before in a previous program and had no problem..? What's the issue here/why? Does it mean I have to make the superclass abstract?