In the section on
In this case, class
Interfaces
, it was noted that a class that implements an interface must implement all of the interface's methods. It is possible, however, to define a class that does not implement all of the interface methods, provided that the class is declared to be abstract
. For example,abstract class X implements Y {
// implements all but one method of Y
}
class XX extends X {
// implements the remaining method in Y
}
X
must be abstract
because it does not fully implement Y
, but class XX
does, in fact, implement
No comments:
Post a Comment