InterviewSolution
| 1. |
In Which Kind Of Situation Would An Interface Be Extended By Another Interface? |
|
Answer» Remember that any class that implements an interface must implement the METHOD headings that are declared in that interface. If that PARTICULAR interface extends from other interfaces, then the IMPLEMENTING class must also implement the methods in the interfaces that are being extended or derived from. As SHOWN in the example above, if we have a class those implements the FourLegs interface, then that class must DEFINE the method headings in both the 'FourLegs' interface and the 'Body' interface. Remember that any class that implements an interface must implement the method headings that are declared in that interface. If that particular interface extends from other interfaces, then the implementing class must also implement the methods in the interfaces that are being extended or derived from. As shown in the example above, if we have a class those implements the FourLegs interface, then that class must define the method headings in both the 'FourLegs' interface and the 'Body' interface. |
|