Page 490 - AP Computer Science A, 7th edition
P. 490
Recall that constructors are not inherited, and if you use the keyword super in writing a constructor for your subclass, the line containing it should precede any other code in the constructor.
Ex a m pl e
public class Dog {
private String name; private String breed;
public Dog (String aName, String aBreed) {
name = aName;
breed = aBreed; }
...
}
public class Poodle extends Dog {
private boolean needsGrooming;
public Poodle (String aName, String aBreed, boolean grooming)
{
super(aName, aBreed);
needsGrooming = grooming; }
...
}
In the Elevens lab there’s extensive discussion about using an abstract class, Board, to represent a game board on which the game of Elevens will be played.
The advantage of the abstract class is that its use can be