I have a base class called Items and 3 derived classes, and within the Items base class i have a print function of the form
public void print(){
Syst
You can't safely retract a newline after it's been printed (outputting a backspace character works depending on the terminal, but you really don't want to do that). I think probably the logical way to architect this is have one superclass function:
public void print() {
System.out.println(toString());
}
And then override toString as needed:
public String toString() {
return "ID " + id + " Title " + title + " <" + year + "> ";
}
public String toString() {
return super.toString() + " ... more stuff";
}