First page Back Continue Last page Graphics
Defining Subclasses
Unlike C++, which allows multiple inheritance, a Java class can only inherit from a single parent class, which is called its superclass
If a class inherits from a superclass, all the public and protected members of the superclass are automatically defined for it
Defining subclasses is accomplished with the extends clause on the class definition
If the extends clause is not used in a class definition then its superclass is the class called Object